Querying ADS from IDL

This page gives information about how to query the ADS abstracts service from IDL. The software should be useful for IDL programmers who would like to efficiently maintain publication lists. Further technical details related to the software are available in a separate document.

The routines are available in the gen/idl/clients/ads branch of Solarsoft (no installation required if you already have Solarsoft).

Obtaining an API key

You will first need to create an account on the modern ADS system: go to https://ui.adsabs.harvard.edu/. If you already have an account on their old system, then you'll still have to create a new account.

Once you've created the account go to Account -> Customize Settings -> API Token. You can then generate a new key for yourself.

Save this string and put it in a file on your computer. I put mine in $HOME/.ads/dev_key. The file dev_key only contains the key token.

Information for a single article

If you have the bibcode for an article, then you can extract information for it by doing:

IDL> str=cit_get_ads_entry('2015ApJ...799..218Y')

The result is a structure with a number of tags. Note that some of the tags are IDL lists. For example:

IDL> n_authors=str.author.count()
IDL> for i=0,n_authors-1 do print,str.author[i]

You may notice that for conference proceedings some basic information, such as editors and conference series, is missing from the output structure. To get these I have to extract them from the article's Bibtex entry (see below).

Constructing an author's publication list

If you're creating your own publication list, I suggest you go to the ADS webpage (https://ui.adsabs.harvard.edu/) and create an ADS library containing all of your publications. If your name is unique then this is straightforward, otherwise it will require a little work to filter out other authors' papers. Once an ADS library is created then you should check out the 'Metrics' section of the ADS page to look at various statistics.

If you want to go further and customize your list and/or do some processing in IDL, then from the ADS page click the 'Export' button and select 'Bibtex'. Download this file and call it something like 'my_papers.bbl'.

You can create a html format list from IDL by doing:

IDL> str=cit_bbl2str('my_papers.bbl')
IDL> cit_author_html,str.id,html='my_papers.html',ads_data=ads_data

This routine has some options to customize the html page - see the header. The optional output ads_data contains the complete list of publications in the format produced by cit_get_ads_entry.pro.

See my own publication page for an example of the output from cit_author_html.

If you're creating publication pages for other people you probably don't want to create an ADS library for each one, but the modern interface has some handy filtering options to get rid of people with the same name (I find the 'keywords' option is good for removing people in a different field).

Customization options

For example,

IDL> cit_author_html,str.id,html='my_papers.html',name='Dr A.B. Smith',author='Dr H.G. Jones',   link_author='http://jones.org',surname='Smith'

The input NAME puts the specified name in the webpage title (should be the person to which the publication list belongs!).

The input AUTHOR specifies the person who created the file, and the name is put in the page footer (note that this name may be different from the NAME input).

The input LINK_AUTHOR allows a link for the author to be specified.

The input SURNAME uses the specified surname to compute first author statistics for the publication list, which are printed to the IDL screen (not to the webpage).

If you maintain an ADS library for your publications, then you can set the input ADS_LIBRARY to the URL for the ADS library.

Note that I use all of these options for creating my own publication list.

Downloading the bibtex entry for a publication

The bibtex entry for a bibcode can be accessed through:

IDL> bib=cit_get_ads_bibtex('2015ApJ...799..218Y')

which returns a string array. Some parts of the bibtex string can be extracted to a structure using:

IDL> str=cit_process_bibtex(bib)

in particular, I use this to extract conference proceedings data not available with cit_get_ads_entry.

Page maintained by Dr Peter Young.