ui.adsabs.harvard.edu
Using the ADS API
1. Get an API token. In your new ADS account, click Account > Customize
Settings, then click on API Token in the left sidebar. Click the Generate a new key
button - your API token is the long series of letters and numbers in the box.
Note: you may make up to
5000 regular queries (or
100 “big queries”) a day
2. Choose an access method. There are several ways to make queries using the
API; choose the method that works best for you:
● Command line using curl*
○ Best for: quick queries, learning to create API searches
● Python scripts using the requests* library
○ Best for: creating scripts, easy translation between command line
curl requests and Python
● Python scripts using the unofficial ADS library
○ Best for: creating advanced scripts, efficient memory usage
3. Start searching. Searches using the API rely on building and sending URLs,
similar to what you’d see in your web browser. Syntax varies based on the
access method, but searches with starred (*) access methods need the following:
● Type of call/HTTP method: GET (default), POST, or PUT; check the ADS
API documentation (https://ui.adsabs.harvard.edu/help/api/) to get the
correct method for your type of request
● Your API token, sent as a header (see examples)
● Base URL: https://api.adsabs.harvard.edu/v1
● Endpoint: the part after the base URL, separated with front-slashes. This
varies based on your request, e.g. /search for simple searches
● Query string: for /search requests, the URL-encoded query parameters, e.g.
/query?q={search parameters}
● Example search URL (uses GET method):
https://api.adsabs.harvard.edu/v1/search/query?q=neutron+star