Giter Club home page Giter Club logo

adsabs-dev-api's Introduction

adsabs-dev-api

ADS Developer API description.

For bugs, feature requests or even random questions feel free to use the issues section.

Table of Contents

The help pages and examples below are formatted as Jupyter notebooks. Browse them in Github or download them to your own computer to edit the code and run as desired. Note that the code in these notebooks was run using an API key or token. This has been edited out of the notebooks for security; acquire your own API key and copy it into the notebook before running it locally.

Note: sometimes Github's internal Jupyter notebook rendering agent fails. If that happens, copy the link to the notebook you wish to view into the form at Jupyter's own notebook renderer.

Clients

The unofficial python client for the API is maintained by Andy Casey described here:

Examples of how to use Andy Casey's Python client can be found here:

Geert Barentsen has built an application to support the Kepler publication database which uses the ADS API to discover relevant papers:

The ADS built an application to compare author's with a wrestling theme at AAS 227:

Access

Access to the ADS data holdings is regulated by the the ADS terms of use, as described in the ADS Terms of Use.

To obtain access to the ADS Developer API you must do two things:

  1. Create an account and log in to the latest version of the ADS.
  2. Push the "Generate a new key" button under the user profile

All API requests must pass your token in an Authorization: Bearer <token> HTTP header (where is the key you just generated), e.g.

curl -H 'Authorization: Bearer <token>' 'https://api.adsabs.harvard.edu/v1/search/query?q=star'

Access Settings

Each endpoint is individually rate-limited. API Responses advertise these limits in their HTTP response headers. A useful way to see these values is to issue a curl request to the desired endpoint with the verbose flag, e.g.:

curl -v -H "Authorization: Bearer <token>" 'https://api.adsabs.harvard.edu/v1/search/query?q=star'

And then noting the following values:

X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4999
X-RateLimit-Reset: 1435190400

The Limit variable indicates the amount of daily queries allowed to the user (in this case 5000). The Remaining variable indicates how many queries are still available. The Reset variable provides a UTC timestamp corresponding to the time the rate limits will be reset. To see its value in human-readable format, you can use the UNIX "date" command:

# syntax for UNIX on a Mac
date -r 1435190400
# Linux syntax
date -d @1435190400
# output for either
Wed Jun 24 20:00:00 EDT 2015

(the rate resetting happens at midnight UTC).
For more information and tips about rate limits, please contact us directly at [email protected].

adsabs-dev-api's People

Contributors

aaccomazzi avatar andycasey avatar ehenneken avatar femalves avatar jonnybazookatone avatar kelockhart avatar lbjay avatar marblestation avatar romanchyla avatar seasidesparrow avatar tjacovich avatar vsudilov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adsabs-dev-api's Issues

401 Unauthorized

Using the example Python snippet:

bibcodes="bibcode\n1907AN....174...59.\n1908PA.....16..445.\n1989LNP...334..242S"
r = requests.post('https://api.adsabs.harvard.edu/v1/search/bigquery', 
       params={'q':'*:*', 'wt':'json', 'fq':'{!bitset}', 'fl':'bibcode'}, 
       headers={'Authorization': 'Bearer: mytokenhere'},
       data=bibcodes)

I get a 401 unathorized response. I can do a curl request with the same token, and it works fine.

Thanks for all the great work and in advance for any help.

Support: Mailing list google group?

@aaccomazzi , could you please comment on the validity of the following statement? Should that be updated?

Announcements and discussion related to the Developer API are available via the Google Group, [adsabs-dev-api](https://groups.google.com/forum/#!forum/adsabs-dev-api). We encourage all API users to subscribe, as the functionality of the API, format of responses, etc., will likely be improving and changing rapidly.

Citation stats are all zeros for 2018ApJ...856L..18M using Metrics API

I've been looking into the Metrics API. For the first bibcode I tried, 2018ApJ...856L..18M, the citation stats that I get out are all zero:

json.loads(requests.post(
  'https://api.adsabs.harvard.edu/v1/metrics', 
  headers={'Authorization': 'Bearer ' + token}, 
  json={'bibcodes': ['2018ApJ...856L..18M']}
).text)

=>

...
 'citation stats': {'number of self-citations': 0,
  'average number of refereed citations': 0.0,
  'median number of citations': 0.0,
  'self-citations': [],
  'number of citing papers': 0,
  'average number of citations': 0.0,
  'median number of refereed citations': 0.0,
  'total number of refereed citations': 0,
  'normalized number of refereed citations': 0,
  'normalized number of citations': 0,
  'total number of citations': 0},
...

For the second bibcode I tried, 2014ApJ...785...10C, the citation stats look fine. The first bibcode shows up with a bunch of citations in the UI and indeed should have a lot.

The fact that I saw this with the very first bibcode I tried suggests that it's not a rare issue. It would be noticed if it were happening in the main UI regularly, so I'm guessing that it's more localized to the Metrics API?

Search queries not returning relevant articles

Hi,

Perhaps I'm missing something here, but search queries don't seem to be working for me. It's not actually returning results that match my query. Instead, it's just returning most recent papers (in whichever sub-field they may be from!)

Examples:
http://labs.adsabs.harvard.edu/adsabs/api/search/?sort=DATE+desc&rows=100&fmt=json&q=black+holes&start=0&dev_key=...

As I understand it, this should yield papers matching 'black holes' in some sense. However, none of the documents returned have the term 'black hole' in their title or abstract.

Without the additional terms, the result is the same:
http://labs.adsabs.harvard.edu/adsabs/api/search/?q=black+holes&dev_key=...

No results with either 'black holes' or 'black', even.

Am I assuming the query term works in the wrong way?

Cheers,
Andy

Some papers not associated with their publications?

Hi

I noticed this interesting behavior in which some papers are not "recognized" to be belonging to publications in which they were published. Minimal working example with a random paper:

?q="pub:Astronomy+and+Astrophysics+identifier:1998A%26A...331..601I"

responds with

{"responseHeader":{"status":0,"QTime":18,"params":{"q":"pub:Astronomy and Astrophysics identifier:1998A&A...331..601I","fl":"id","wt":"json"}},"response":{"numFound":0,"start":0,"docs":[]}}

i.e. this file was not found. But the the paper with this identifier exists (and its "pub" value is exactly Astronomy and Astrophysics! ), and there is a positive response where executing the same command without pub part..

?q="identifier:1998A%26A...331..601I".

This happens only rarely, most of the time there is no problem. For instance,

?q="pub:Astronomy+and+Astrophysics+identifier:1999A%26A...341....8R"

responds with positive find without any problems, as do many others.

Is this a problem in the database, or am I seriously misunderstanding something?

Example curl request in README does not produce X-RateLimit headers

I'm using powershell on a windows 10 machine and I'm trying to figure out how to check my rate limits. Using the example in the README, I don't get any X-RateLimit response headers. For this input:
curl.exe -v -H "Authorization: Bearer <token>" 'https://api.adsabs.harvard.edu/v1/search/query?q=star'
I get this output:

*   Trying 34.197.154.114...
* TCP_NODELAY set
* Connected to api.adsabs.harvard.edu (34.197.154.114) port 443 (#0)
* schannel: SSL/TLS connection with api.adsabs.harvard.edu port 443 (step 1/3)
* schannel: checking server certificate revocation
* schannel: sending initial handshake data: sending 187 bytes...
* schannel: sent initial handshake data: sent 187 bytes
* schannel: SSL/TLS connection with api.adsabs.harvard.edu port 443 (step 2/3)
* schannel: failed to receive handshake, need more data
* schannel: SSL/TLS connection with api.adsabs.harvard.edu port 443 (step 2/3)
* schannel: encrypted data got 4096
* schannel: encrypted data buffer: offset 4096 length 4096
* schannel: encrypted data length: 4030
* schannel: encrypted data buffer: offset 4030 length 4096
* schannel: received incomplete message, need more data
* schannel: SSL/TLS connection with api.adsabs.harvard.edu port 443 (step 2/3)
* schannel: encrypted data got 1024
* schannel: encrypted data buffer: offset 5054 length 5054
* schannel: received incomplete message, need more data
* schannel: SSL/TLS connection with api.adsabs.harvard.edu port 443 (step 2/3)
* schannel: encrypted data got 477
* schannel: encrypted data buffer: offset 5531 length 6078
* schannel: sending next handshake data: sending 126 bytes...
* schannel: SSL/TLS connection with api.adsabs.harvard.edu port 443 (step 2/3)
* schannel: encrypted data got 274
* schannel: encrypted data buffer: offset 274 length 6078
* schannel: SSL/TLS handshake complete
* schannel: SSL/TLS connection with api.adsabs.harvard.edu port 443 (step 3/3)
* schannel: stored credential handle in session cache
> GET /v1/search/query?q=star HTTP/1.1
> Host: api.adsabs.harvard.edu
> User-Agent: curl/7.55.1
> Accept: */*
> Authorization: Bearer <token>
>
* schannel: client wants to read 102400 bytes
* schannel: encdata_buffer resized 103424
* schannel: encrypted data buffer: offset 0 length 103424
* schannel: encrypted data got 1722
* schannel: encrypted data buffer: offset 1722 length 103424
* schannel: decrypted data length: 1693
* schannel: decrypted data added: 1693
* schannel: decrypted data cached: offset 1693 length 102400
* schannel: encrypted data buffer: offset 0 length 103424
* schannel: decrypted data buffer: offset 1693 length 102400
* schannel: schannel_recv cleanup
* schannel: decrypted data returned 1693
* schannel: decrypted data buffer: offset 0 length 102400
< HTTP/1.1 200 OK
< Date: Thu, 07 Jan 2021 19:52:50 GMT
< Content-Type: application/json
< Content-Length: 419
< Connection: keep-alive
< Server: openresty/1.15.8.1
< Vary: Accept-Encoding
< Access-Control-Allow-Origin: http://0.0.0.0:8000, http://adsabs.harvard.edu, http://adsx.cfa.harvard.edu:8888, http://hourly.adslabs.org, http://localhost:8000, http://ui.adsabs.harvard.edu, http://ui.adslabs.org, https://arxiv.org, https://beta.arxiv.org, https://demo.adsabs.harvard.edu, https://dev.adsabs.harvard.edu, https://devui.adsabs.harvard.edu, https://experimental-bumblebee.us-east-1.elasticbeanstalk.com, https://prod.adsabs.harvard.edu, https://staging-bumblebee.elasticbeanstalk.com, https://staging-bumblebee.us-east-1.elasticbeanstalk.com, https://ui.adsabs.harvard.edu
< Access-Control-Allow-Methods: DELETE, GET, OPTIONS, POST, PUT
< Access-Control-Allow-Headers: Accept, Authorization, Content-Type, Orcid-Authorization, X-BB-Api-Client-Version, X-CSRFToken
< Access-Control-Allow-Credentials: true
< Vary: Origin
< Set-Cookie: session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSinKJLPcPiTT1c_fK8QvJyY0MyckG8it9q0Irolx8gXLJlZHhbjm-Ia62SrVAvQWpRbmJeal5JTDTSotTi8AmKhkZm5mZKtUCAA_bJIo.X_dmkg.W5Vy71TL5bBBk2MJbKRLyBk25_M; Expires=Sat, 08-Jan-2022 01:52:50 GMT; HttpOnly; Path=/
<
{"responseHeader":{"status":0,"QTime":189,"params":{"q":"star","fl":"id","start":"0","internal_logging_params":"X-Amzn-Trace-Id=Root=1-5ff76692-1340a6952264327a0c48d782","rows":"10","wt":"json"}},"response":{"numFound":538096,"start":0,"docs":[{"id":"7258815"},{"id":"12215563"},{"id":"7887328"},{"id":"7444840"},{"id":"11924081"},{"id":"482875"},{"id":"3843131"},{"id":"11219199"},{"id":"7259204"},{"id":"5098246"}]}}
* Connection #0 to host api.adsabs.harvard.edu left intact

Links to new help docs

So I don't forget, the links should point to the new help pages and not older ones. For example, the privacy policy.

SSL certificate error

Hi,
Today I noticed I'm getting this error when I try to make a query through the command line:

 curl -H 'Authorization: Bearer <token>' 'https://api.adsabs.harvard.edu/v1/search/query?q=star'
curl: (60) SSL certificate problem: certificate has expired
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.

Similarly when I try to do the query through the Python requests package:

bibm ads-search
(Press 'tab' for autocomplete)                                                  
author:"buchner, j" property:refereed                                           
Traceback (most recent call last):
  File "/home/pcubillos/py36/lib/python3.6/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/home/pcubillos/py36/lib/python3.6/site-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/home/pcubillos/py36/lib/python3.6/site-packages/urllib3/connectionpool.py", line 839, in _validate_conn
    conn.connect()
  File "/home/pcubillos/py36/lib/python3.6/site-packages/urllib3/connection.py", line 344, in connect
    ssl_context=context)
  File "/home/pcubillos/py36/lib/python3.6/site-packages/urllib3/util/ssl_.py", line 344, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib/python3.6/ssl.py", line 407, in wrap_socket
    _context=self, _session=session)
  File "/usr/lib/python3.6/ssl.py", line 814, in __init__
    self.do_handshake()
  File "/usr/lib/python3.6/ssl.py", line 1068, in do_handshake
    self._sslobj.do_handshake()
  File "/usr/lib/python3.6/ssl.py", line 689, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pcubillos/py36/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/home/pcubillos/py36/lib/python3.6/site-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/home/pcubillos/py36/lib/python3.6/site-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.adsabs.harvard.edu', port=443): Max retries exceeded with url: /v1/search/query?q=author%3A%22buchner%2C%20j%22%20property%3Arefereed&start=0&rows=200&sort=pubdate+desc&fl=title,author,year,bibcode,pub (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)'),))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pcubillos/py36/bin/bibm", line 11, in <module>
    load_entry_point('bibmanager', 'console_scripts', 'bibm')()
  File "/home/pcubillos/Dropbox/IWF/projects/2018_bibmanager/bibmanager/bibmanager/__main__.py", line 1088, in main
    args.func(args)
  File "/home/pcubillos/Dropbox/IWF/projects/2018_bibmanager/bibmanager/bibmanager/__main__.py", line 263, in cli_ads_search
    am.manager(query)
  File "/home/pcubillos/Dropbox/IWF/projects/2018_bibmanager/bibmanager/bibmanager/ads_manager/ads_manager.py", line 47, in manager
    results, nmatch = search(query, start=start)
  File "/home/pcubillos/Dropbox/IWF/projects/2018_bibmanager/bibmanager/bibmanager/ads_manager/ads_manager.py", line 120, in search
    headers={'Authorization': f'Bearer {token}'})
  File "/home/pcubillos/py36/lib/python3.6/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/home/pcubillos/py36/lib/python3.6/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/home/pcubillos/py36/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/pcubillos/py36/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/home/pcubillos/py36/lib/python3.6/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.adsabs.harvard.edu', port=443): Max retries exceeded with url: /v1/search/query?q=author%3A%22buchner%2C%20j%22%20property%3Arefereed&start=0&rows=200&sort=pubdate+desc&fl=title,author,year,bibcode,pub (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)'),))

I'm pretty sure nothing has changed on my end since the last time it was working. Is this an error that will get fixed or should I turn off the certificate verification from now on?

Thanks!

Query of library content returns limited number of items

I am trying to follow the logic at https://github.com/adsabs/adsabs-dev-api/blob/master/Libraries_API.ipynb (or via python at https://github.com/adsabs/adsabs-dev-api/blob/master/Converting_curl_to_python.ipynb) to get all of the bibcodes associated with a library. However, while it returns the correct number of bibcodes in the metadata, the number of actual bibcodes returned is far smaller. e.g.,

{u'documents': [u'2018MNRAS.478.1784B', u'2018MNRAS.478.2835L', u'2018MNRAS.478.1763L', u'2018MNRAS.477.5167Z', u'2018ApJ...859...93L', u'2018arXiv180603136C', u'2018arXiv180606076J', u'2018ApJ...859...47A', u'2018ApJ...858L..15D', u'2018ApJ...857..131K', u'2018ApJS..235...37A', u'2018ApJ...857...11T', u'2018ApJ...855..122V', u'2018ApJ...855...14K', u'2018ApJ...854L..13H', u'2018Natur.554..207M', u'2017Sci...358.1579H', u'2017PASA...34...70X', u'2017Sci...358.1559K', u'2017PASA...34...69A'], u'solr': {u'responseHeader': {u'status': 0, u'QTime': 10, u'params': {u'sort': u'date desc', u'fq': u'{!bitset}', u'rows': u'20', u'q': u':', u'start': u'0', u'wt': u'json', u'fl': u'bibcode,alternate_bibcode'}}, u'response': {u'start': 0, u'numFound': 198, u'docs': [{u'alternate_bibcode': [u'2018arXiv180411048B', u'2018MNRAS.tmp.1098B'], u'bibcode': u'2018MNRAS.478.1784B'}, {u'alternate_bibcode': [u'2018arXiv180505482L', u'2018MNRAS.tmp.1255L'], u'bibcode': u'2018MNRAS.478.2835L'}, {u'alternate_bibcode': [u'2018arXiv180411006L', u'2018MNRAS.tmp.1077L'], u'bibcode': u'2018MNRAS.478.1763L'}, {u'alternate_bibcode': [u'2018arXiv180407060Z', u'2018MNRAS.tmp..905Z'], u'bibcode': u'2018MNRAS.477.5167Z'}, {u'alternate_bibcode': [u'2018arXiv180504951L'], u'bibcode': u'2018ApJ...859...93L'}, {u'bibcode': u'2018arXiv180603136C'}, {u'bibcode': u'2018arXiv180606076J'}, {u'alternate_bibcode': [u'2018arXiv180102617A'], u'bibcode': u'2018ApJ...859...47A'}, {u'alternate_bibcode': [u'2018arXiv180306853D'], u'bibcode': u'2018ApJ...858L..15D'}, {u'alternate_bibcode': [u'2018arXiv180303587K'], u'bibcode': u'2018ApJ...857..131K'}, {u'alternate_bibcode': [u'2018arXiv180101837A'], u'bibcode': u'2018ApJS..235...37A'}, {u'alternate_bibcode': [u'2018arXiv180209276T'], u'bibcode': u'2018ApJ...857...11T'}, {u'alternate_bibcode': [u'2017arXiv171111063V'], u'bibcode': u'2018ApJ...855..122V'}, {u'alternate_bibcode': [u'2018arXiv180109598K'], u'bibcode': u'2018ApJ...855...14K'}, {u'alternate_bibcode': [u'2017arXiv171200949H'], u'bibcode': u'2018ApJ...854L..13H'}, {u'alternate_bibcode': [u'2017arXiv171111573M'], u'bibcode': u'2018Natur.554..207M'}, {u'alternate_bibcode': [u'2017arXiv171005435H'], u'bibcode': u'2017Sci...358.1579H'}, {u'alternate_bibcode': [u'2017arXiv171108933X'], u'bibcode': u'2017PASA...34...70X'}, {u'alternate_bibcode': [u'2017arXiv171005436K'], u'bibcode': u'2017Sci...358.1559K'}, {u'alternate_bibcode': [u'2017arXiv171005846A'], u'bibcode': u'2017PASA...34...69A'}]}}, u'updates': {u'update_list': [], u'num_updated': 0, u'duplicates_removed': 0}, u'metadata': {u'num_documents': 198, u'description': u'My ADS library', u'name': u'Kaplan', u'permission': u'owner', u'id': u'AtijQpcVQomL3joNFBVn2A', u'num_users': 1, u'owner': u'kaplan', u'date_created': u'2018-07-05T18:16:21.669709', u'public': True, u'date_last_modified': u'2018-07-05T18:16:26.738949'}}

It claims that there are 198 documents, but only 20 are returned. I tried specifying the number of rows via <url>&rows=30 or params={"rows":30}, in python, but neither works: the former gives me a server error while the latter is ignored.

Is there any way around this limit?

When will a native python library for library access be available?

David

Can't get ratelimits

I've been using the unofficial Python interface from Andy Casey for a bit. A few weeks ago I was able to use his code to get ratelimits on my API token but now I can't get them using the same code. I can query the database and get the data I want but the ratelimits are just empty strings. I don't really know what I'm doing, but I've tried to inspect HTTP response headers using the Python requests package and I can't find anything like X-RateLimit in API query responses.

I've done

import requests
r = requests.get("https://api.adsabs.harvard.edu/v1/search/query?q=q", headers={'Authorization': 'Bearer ' + token})

and the resulting r.headers data is

{'Date': 'Wed, 23 Dec 2020 23:23:36 GMT', 
'Content-Type': 'application/json', 
'Transfer-Encoding': 'chunked', 
'Connection': 'keep-alive', 
'Server': 'openresty/1.15.8.1', 
'Vary': 'Accept-Encoding, Origin', 
'Access-Control-Allow-Origin': 'http://0.0.0.0:8000, http://adsabs.harvard.edu, http://adsx.cfa.harvard.edu:8888, http://hourly.adslabs.org, http://localhost:8000, http://ui.adsabs.harvard.edu, http://ui.adslabs.org, https://arxiv.org, https://beta.arxiv.org, https://demo.adsabs.harvard.edu, https://dev.adsabs.harvard.edu, https://devui.adsabs.harvard.edu, https://experimental-bumblebee.us-east-1.elasticbeanstalk.com, https://prod.adsabs.harvard.edu, https://staging-bumblebee.elasticbeanstalk.com, https://staging-bumblebee.us-east-1.elasticbeanstalk.com, https://ui.adsabs.harvard.edu',
'Access-Control-Allow-Methods': 'DELETE, GET, OPTIONS, POST, PUT', 
'Access-Control-Allow-Headers': 'Accept, Authorization, Content-Type, Orcid-Authorization, X-BB-Api-Client-Version, X-CSRFToken', 
'Access-Control-Allow-Credentials': 'true',
'Set-Cookie': 'session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJSiqyKyvR198rwdw819g_3rPQNjzT2Mwo0jMpyy_B3CTWJCvfLjsoKNIoK8bRVqgXqLUgtyk3MS80rgZlWWpxaBDZRycjYzMxUqRYAxUsjOQ.X-PReA.3RHeqO_ym_NSaYhW0t0uh1yunDw; Expires=Fri, 24-Dec-2021 05:23:36 GMT; HttpOnly; Path=/',
'Content-Encoding': 'gzip'}

How should I get my ratelimits in Python?

Can't use != to check if an article exists in a container

I'm using the API to get a set of articles and then iterating over a pandas DataFrame containing those articles, searching for references from or citations to articles found in the first round of searches. I'm currently using the string 'x' for cells that do not contain useful data. To run the second set of searches I do

if (dataframe['columnWithArticles'].loc[index] != 'x'):
    #code with SearchQueries

But when the column with articles contains an article this comparison fails with the following error

c:\users\appdata\local\programs\python\python38-32\lib\site-packages\ads\search.py in __ne__(self, other)
     56
     57     def __ne__(self, other):
---> 58         return not self.__eq__(other)
     59
     60     def keys(self):

c:\users\appdata\local\programs\python\python38-32\lib\site-packages\ads\search.py in __eq__(self, other)
     52     def __eq__(self, other):
     53         if self._raw.get("bibcode") is None or other._raw.get("bibcode") is None:
---> 54             raise TypeError("Cannot compare articles without bibcodes")
     55         return self._raw['bibcode'] == other._raw['bibcode']
     56

TypeError: Cannot compare articles without bibcodes

I expected that article objects would be unequal to an object of any other type, but it looks like articles can only handle comparisons to objects with bibcode attributes. Is this a bug or is this expected behavior?

Dumping all personal libraries into a bibtex file

Dear Developers,

I was struggling in the past to collect references and then had to redo the job again and again. Using ADS personal libraries is very convenient. However, for a large number of libraries exporting can become cumbersome.
I have written a python script, using some of the code made available on these pages to dump personal libraries in a local bibtex file: it is at
https://gitlab.astro.unige.ch/ferrigno/adslibraries
and available in pip
pip install adslibraries

Should you find it useful, you could put a link somewhere.
I will likely develop some features if I need them in the future.

Best wishes,
Carlo

Is an integrated `read_count` available?

I understand from #11 that the read_count field is a "90-day count of views and
downloads from ads and arxiv
".

Is there also a field that gives the total read count integrated over the entire life of the article, or could such a field be made available?

Bibcode existence check

For the IVOA document repo to ADS converter, I'd like to (in the future) filter out records ADS already has, and I'd like to avoid local state to do this (i.e., an already-uploaded.txt file).

For that, at one point, the API let me post a list of bibcodes to a query like

q=%2A%3A%2A&fq=%7B%21bitset%7D&wt=json&fl=bibcode

Any chance this might come back in some form or another?

Or what else should I do to mass-check for the existence of bibcodes?

Sort by pubdate does not work

A query with "&sort=pubdate+desc" worked until recently but now returns results in the default sort order, and the sort field in the returned data is empty. "&sort=date+desc" works instead, but I also tried sorting by bibcode, abstract and title, and these did not work either.

Rate limit was exceeded

I get "Rate limit was exceeded" even though I am nowhere near the limit:

< X-RateLimit-Limit: 5000
< X-RateLimit-Remaining: 4864
< X-RateLimit-Reset: 1458000000

export wth wrong xsd location and xml namespace in refabsxml format

Hi,

Moving an old code to your new API I just see a small error in the export xml associated to the next export url :
https://api.adsabs.harvard.edu/v1/export/refabsxml
I guess that namespace url should be http://ads.harvard.edu/schema/abs/1.1/abstracts instead of http://ads.harvard.edu/schema/abs/1.1/abstract
Then it will be more consistent with the present xsd file : http://ads.harvard.edu/schema/abs/1.1/abstracts.xsd

http://ads.harvard.edu/schema/abs/1.1/abstract.xsd is not found

Could you please fix the export template with old namespace ?
All the best,
Guillaume

Punctuation characters in DOI trigger syntax error

Possibly related to #15?
Passing a DOI that contains parentheses causes a syntax error.

curl -H %TOKEN% "https://api.adsabs.harvard.edu/v1/search/query?data_type=XML&q=doi:10.1206/0003-0082(2008)3610[1:nrofwf]2.0.co;2"
fails (as expected: not URL-encoded).

curl -H %TOKEN% "https://api.adsabs.harvard.edu/v1/search/query?data_type=XML&q=doi:10.1206%2F0003-0082%282008%293610%5B1%3Anrofwf%5D2.0.co%3B2"
fails with error:

INVALID_SYNTAX_CANNOT_PARSE: Syntax Error, cannot parse doi:10.1206/0003-0082(2008)3610[1:nrofwf]2.0.co;2: The parser reported a syntax error, antlrqueryparser hates errors!
(Not expected: doi=10.1038%2Fnature09068, with / urlencoded, is successful)

Double-encoding the doi:
curl -H %TOKEN% "https://api.adsabs.harvard.edu/v1/search/query?data_type=XML&q=doi:10.1206%252F0003-0082%25282008%25293610%255B1%253Anrofwf%255D2.0.co%253B2"
returns a response header, but with the DOI URLencoded (and thus no search results).

Metrics API

Hola,

Is there any (unofficial or otherwise) documentation about the capabilities of the metrics API? Specifically if one were interested in sorting astronomers by some field (e.g., normalised citations), would something like that be available through the metrics API?

At the moment the only way I can see a way to do something like this would be to find highly cited papers (with a wildmask search, sorted by citations), get the names of the authors from the first X papers, then start searching for papers by those names in order to (reasonably) rank top people publishing by their normalised citations. However, for example, if one wanted to know the top 1000 astronomers as ranked by normalised citations, this becomes an expensive exercise.

So, I'm just wondering if the metrics API will have any kind of capabilities like this, or doing something like I propose is the best way forward for the immediate future.

rule about link_type of full text sources

I want to make service like https://ui.adsabs.harvard.edu/#

how can i know what kind of full text source is available?
i can't find specific rule about link_type.

http://adsabs.harvard.edu/cgi-bin/nph-data_query?bibcode={doc.bibcode}&link_type={link_type}

Is there any relationship between link type and property field?
or should I find other field?

Currently, I'm working on my project using property field but something goes wrong

for example

in https://ui.adsabs.harvard.edu/#abs/2017NewA...55...32F/abstract
doen't show Publisher Article source
but i can access to
http://adsabs.harvard.edu/cgi-bin/nph-data_query?bibcode=2017NewA...55...32F&link_type=EJOURNAL
and it have 'ARTICLE' value in property field

in https://ui.adsabs.harvard.edu/#abs/1536zvwv.book.....E/abstract
it have 'NONARTICLE' value in property field
but it show Publisher Article.

Unauthorized/404 response to libraries API

Hola compadres,

I've branched the ADS client with the aim to make use of the libraries API, but I am encountering some rudimentary troubles. In short, I am getting 404's or unauthorized responses to a simple get method to list all my private libraries:

 ads arc$ curl -H 'Authorization: Bearer <TOKEN>' 'https://api.adsabs.harvard.edu/v1/biblib/'
{
  "error": "Not found"
}ads arc$ curl -H 'Authorization: Bearer <TOKEN>' 'https://api.adsabs.harvard.edu/v1/biblib'
{
  "error": "Not found"
}ads arc$ curl -H 'Authorization: Bearer <TOKEN>' 'https://api.adsabs.harvard.edu/v1/biblib/libraries'
{
  "error": "Unauthorized"
}ads arc$ curl -H 'Authorization: Bearer <TOKEN>' 'https://api.adsabs.harvard.edu/v1/biblib/libraries/'
{
  "error": "Unauthorized"
}

(Obviously, <TOKEN> has been replaced here with my real token)

I have one library in BBB, which is public but has no documents. Where have I screwed up here?

Thanks!

lazy loading of citation field not possible

I like to find out which papers cite which of my papers. This works fine:

query = ads.SearchQuery(q="author:hippke,m",)
for paper in query:
    print(paper.bibcode, paper.citation_count, paper.citation)

Unfortunately, it costs me n queries from my rate limit where n is the number of my papers.
A solution to use lazy loading was suggested in this issue for exactly my use case. BUT when I add to the ads.SearchQuery:

fl=['bibcode', 'citation_count', 'citation']

I get "None" for the paper.citation instead the list of bibcodes.
Any help appreciated!

Possible default limit in output rows

Nice API! I am using it to update some legacy code, which will now be about two orders of magnitude faster, so thanks!

I am using the /bigquery endpoint, and sending a list of approximately 4000 bibliographic codes. I set rows in the input parameters to the number of bibcodes (rows: 4129). In the response header the number of rows is now limited to 2000, which is the number of elements in the response_json['response']['docs'] list. The contents of these results are otherwise as expected. Here is the response JSON:

{
    "responseHeader": {
        "status": 0, 
        "QTime": 83,
        "params": {
            "q": "*:*",
            "fq": "{!bitset}",
            "rows": "2000",
            "fl": "bibcode,citation_count,first_author,author",
            "wt": "json"
        }
    },
    "response": {"start": 0, "numFound": 4129, "docs": [...]}
}

I noticed that numFound corresponded to the expected number of output rows, so I wondered if there was a hardcoded limit on the number of returned rows, somewhere after Solr performs the query, set to 2000? It seems a bit strange to have a limit only on the amount of data returned in the response, not also applying to the input to Solr. Should I be limiting my queries to 2000 bibcodes, or should I be expecting all 4129 results in the HTTP response?

Thanks in advance.

BibTeX Export for Search API possible?

Hello,

I am one of the JabRef developers and we would like to make use of your new API. We currently have a fetcher that still relies on the classic version of your system.

As I have seen, currently the API returns json. Would it be possible to have an option to get the search results in the bibtex format?

Thanks in advance.
Christoph
JabRef Developer

Number of rows returned from query limited to 2000?

Hello,

I am trying to extract citation statistics for various journals by running two queries looped over a range in years:

for yr in yearlist:
articles = list(ads.SearchQuery(q="(year:"+yr+" bibstem:"+journal+" AND citation_count:[0 TO 999990]) +property:refereed -title:erratum",fl=fllist,rows=3000))
zeroarticles = list(ads.SearchQuery(q="(year:"+yr+" bibstem:"+journal+" AND citation_count:[0 TO 0]) +property:refereed -title:erratum",fl=fllist,rows=3000))
...

I have found that
(1) If I do not set the rows parameter, I get a maximum of 50 results.
(2) If I set rows to 2000, I get at most 2000 results.
(3) If I set rows to a number larger than 2000, I get a maximum of 2000 results.
(4) It does not seem to matter if I set rows to a int or string in the SearchQuery call

I need to be able to return more than 2000 results, or hack around this limit by doing more smaller time range queries (which might cause me to approach my query limit). Is there a reason for the rows=2000 upper limit? If not, can it be increased? Thanks.

-- Jeff

post results preserve order of input bibcodes (feature request?)

Hi, when I make a post request by bibcodes, is it possible to return a list of results with an item (the BibTeX entries) for each input bibcode, preserving order?

Looking at the documentation, a post request returns a single string containing all found BibTeX entries regardless of the number of input bibcodes. These can be sorted by fields, but not by the input order. Thus, there are cases when one cannot easily find the corresponding BibTeX for each input bibcode (e.g., a multiple-bibcode request, providing alternate bibcodes, see MWE below).

Sorting by bibcode does not help, since the order can change if one provides an alternate_bibcode that turns into a bibcode.

Splitting the request into a series of single-bibcode posts does not seem like a good option, since it loses the advantage of requesting all bibcodes at once, and consumes the daily requests.

I could potentially do a cross-check (between input bibcodes and result BibTeX entries), but I think this is below optimal as well, since I'm not sure one can cover all cases (arxiv format have changed over time, and I don't know whether there are other alternate_bibcode cases beside arXiv).

Thanks for all your work putting up this API!

MWE:

import requests
import json

my_token = 'my_token_here'
r = requests.post("https://api.adsabs.harvard.edu/v1/export/bibtex",
    headers={"Authorization": f'Bearer {my_token}',
             "Content-type": "application/json"},
    data=json.dumps({"bibcode":['2010arXiv1007.0324B', '2017arXiv170908635K']}))
print(r.json()["export"])
@ARTICLE{2018ApJ...858L...6K,
       author = {{Kreidberg}, Laura and {Line}, Michael R. and {Thorngren}, Daniel and
        {Morley}, Caroline V. and {Stevenson}, Kevin B.},
        title = "{Water, High-altitude Condensates, and Possible Methane Depletion in the Atmosphere of the Warm Super-Neptune WASP-107b}",
      journal = {\apj},
     keywords = {planets and satellites: atmospheres, planets and satellites: composition, planets and satellites: individual: WASP-107b, Astrophysics - Earth and Planetary Astrophysics},
         year = 2018,
        month = May,
       volume = {858},
          eid = {L6},
        pages = {L6},
          doi = {10.3847/2041-8213/aabfce},
archivePrefix = {arXiv},
       eprint = {1709.08635},
 primaryClass = {astro-ph.EP},
       adsurl = {https://ui.adsabs.harvard.edu/\#abs/2018ApJ...858L...6K},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

@ARTICLE{2011ApJ...731...16B,
       author = {{Beaulieu}, J. -P. and {Tinetti}, G. and {Kipping}, D.~M. and {Ribas},
        I. and {Barber}, R.~J. and {Cho}, J.~Y. -K. and {Polichtchouk},
        I. and {Tennyson}, J. and {Yurchenko}, S.~N. and {Griffith},
        C.~A. and {Batista}, V. and {Waldmann}, I. and {Miller}, S. and
        {Carey}, S. and {Mousis}, O. and {Fossey}, S.~J. and {Aylward},
        A.},
        title = "{Methane in the Atmosphere of the Transiting Hot Neptune GJ436B?}",
      journal = {\apj},
     keywords = {planetary systems, techniques: spectroscopic, Astrophysics - Earth and Planetary Astrophysics},
         year = 2011,
        month = Apr,
       volume = {731},
          eid = {16},
        pages = {16},
          doi = {10.1088/0004-637X/731/1/16},
archivePrefix = {arXiv},
       eprint = {1007.0324},
 primaryClass = {astro-ph.EP},
       adsurl = {https://ui.adsabs.harvard.edu/\#abs/2011ApJ...731...16B},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

Typo in document

Hi,
for the example to get specific metrics (https://github.com/adsabs/adsabs-dev-api/blob/master/metrics.md) I tried using "types" delimited by single apostrophe but the server didn't like it:
curl -H "Authorization: Bearer " -H "Content-Type: application/json" -X POST -d '{"bibcodes":["1980ApJS...44..137K","1980ApJS...44..489B"],'types':['basic']}' https://api.adsabs.harvard.edu/v1/metrics

So I changed it to be consistent with the bibcodes and use double-quotes and it worked.

Hope this helps someone.

pdf downloads with curl fail with captcha message

I have set up API token as recommended. I followed the guide to download pdfs directly.
For arXiv pdfs, this works:

curl -H "Authorization: Bearer $token" 'https://ui.adsabs.harvard.edu/link_gateway/2005ApJ...618..426M/EPRINT_PDF' -L -o 't.pdf'

However, for the published paper, this
curl -H "Authorization: Bearer $token" 'https://ui.adsabs.harvard.edu/link_gateway/2005ApJ...618..426M/PUB_PDF' -L -o 't.pdf'

"downloads" a pdf which is some html coded text with warnings about how my activity is suspected to be a robot:
We apologize for the
inconvenience...
...but your activity and behavior on this site made us think that you are
t.pdf
a bot.
Note:A number of things could be going on here. If you are attempting to access this site using an anonymous Private/Proxy network, please disable that and try accessing site again. Due to previously detected malicious behavior which originated from the network you're using, please request unblock to site. Please solve this CAPTCHA to request unblock to the website

That shouldn't be happening since I've registered for the token, right? Never dreamed of doing anything "malicious" apart from this sort of thing, which has been working for years via my own shell scripts (without token until recently). I never bulk downloaded anything. In any case, what is the purpose of registering for the token, if I'm still seen as a robot?

Thanks!

Match regular expression on "body" field

Hi there,

I am working with the US National Gemini Office within NOIRLab, trying to automate the search for new publications with the Gemini Observatory data, but subdividing it by partner country based on the program ID. Currently, I am able to use the "bibgroup:gemini" successfully on the ADS search API, but I also wanted to search the entire text (including acknowledgments) and find the specific Gemini Program ID. That is needed to cross-match with the observing database and assign a given paper to the partner country from which the data came (for statistical purposes). I tried filtering by the countries listed on the affiliations. Even though that works, it does not give an accurate count for various reasons.

I wanted to be able to search for the following regular expression

G[NS].*20[0-9][0-9][AB].*[0-9][0-9][0-9]

This regex accounts for all valid program IDs (e.g. GS-2020A-Q-123) and also for the most common mistakes (GS2020A-Q123 and so on).

Being able to find articles when parameters have values of None

Hi ADSABS team!

I am using your api in a simple program to search for articles in your database. However, whenever I try to search up an article and do not have specific parameters, then the result which should be coming doesn't come. Here is my querystring -


querystring = {"q": "first_author:" + first_author + ",year:" + year + ", volume:" + volume + ", 
                       page:" + pages[0],
                       "fl": "bibcode,page,desc,title,author,volume"}

Let's say that I do not know the information for the volume and that has a value of None. If I was to send that request, then the API wouldn't return the correct response. How do I make it so that even I do not have the values for one or two parameters, then it would still be able to send a request and correctly give a response and find a doc.

Impossible to get articles by entdate

I am trying to replicate the following query via the API:

entdate:[2020-01-15 TO 2020-01-16]

In the web UI it correctly returns entries from that date range, however when I run a corresponding API query:

curl -H 'Authorization: Bearer <token>' 'https://api.adsabs.harvard.edu/v1/search/query?entdate=%5B2020-01-10%20TO%202020-01-16%5D'|jq

I get an error stating that the query was empty.

{
  "responseHeader": {
    "status": 400,
    "QTime": 0,
    "params": {
      "rows": "10",
      "start": "0",
      "wt": "json",
      "entdate": "[2020-01-10 TO 2020-01-16]",
      "fl": "id"
    }
  },
  "error": {
    "msg": "org.apache.solr.common.SolrException: The query is empty",
    "code": 400,
    "metadata": [
      "error-class",
      "org.apache.solr.common.SolrException",
      "root-error-class",
      "org.apache.solr.common.SolrException"
    ]
  }
}

Is this behavior intended? If yes, is there a way to achieve the desired result?

Can't remove from library some papers submitted with arXiv bibcodes

This may not be the case if the arXiv has no journal counterpart... In my case I just wanted to clear the whole list but the ui did not send the original (arXiv) bibcode to be removed (they have been replaced).

Ok I can delete the lib and create again. But this small issue may hide some other side effect (counting mismatch...).

What are the constraints on library names

First, thank a lot for your API and associated services which help us a lot to combine multiples tools.
( it could be fun (or I like to imagine) to set VO/SAMP on both tool so we can do more than the sum of the two services ;) )

I then created many libraries using names coming from another database. I get a 500 error with message="INTERNAL SERVER ERROR" for one of them.
I guess that it is related to the maximum length allowed for the name field.

Is there a way to get a better error message ?

I double check the documentation but did not find any word about such constraint that can help to design code.

Regards,

Guillaume

Recent update?

Recently, bibslurp stopped working (mkmcc/bibslurp#12 (comment)). I suspect that something changed in the APIs. I think that the following used to work:

curl -d "bibcode=2010PhRvD..82j4014W" -H 'Authorization: Bearer MY_TOKEN' 'https://api.adsabs.harvard.edu/v1/export/bibtex'

but now it doesn't anymore and I need to send the data as '-d {"bibcode":"2010PhRvD..82j4014W"}.

I cannot find any announcement about any change. Has there been any change on the server side?

Inconsistent length of the orcid arrays and author list

We found several examples of records where the length of the authors list and that of the ORCID arrays (_pub, _user, _other) is different.

In some cases also the size of the orcid arrays is inconsistent, with a _pub array longer than the others.

We are still investigating the issue and we should be able to provide a long list of bibcode to verify, in the coming days.

A first example is 2014ASPC..486..203M

Best regards

Claudio

Syntax error while parsing DOI

I am trying to look up this DOI: 10.1007/jhep0(.2013)041. This leads to a syntax error when using the API. It leads to an internal error when I use the search field on the web page.

The full error message I receive is (I am using Julia, but the error should be "readable" anyway):

ERROR: HTTP.ExceptionRequest.StatusError(400, "GET", "/v1/search/query?q=doi:10.1007%2Fjhep07%282013%29041&fl=bibcode,citation_count", HTTP.Messages.Response:
"""
HTTP/1.1 400 Bad Request
Date: Tue, 28 Jul 2020 04:00:40 GMT
Content-Type: application/json
Content-Length: 565
Connection: keep-alive
Server: openresty/1.15.8.1
Access-Control-Allow-Origin: http://0.0.0.0:8000, http://adsabs.harvard.edu, http://adsx.cfa.harvard.edu:8888, http://hourly.adslabs.org, http://localhost:8000, http://ui.adsabs.harvard.edu, http://ui.adslabs.org, https://arxiv.org, https://beta.arxiv.org, https://demo.adsabs.harvard.edu, https://dev.adsabs.harvard.edu, https://devui.adsabs.harvard.edu, https://experimental-bumblebee.us-east-1.elasticbeanstalk.com, https://prod.adsabs.harvard.edu, https://staging-bumblebee.elasticbeanstalk.com, https://staging-bumblebee.us-east-1.elasticbeanstalk.com, https://ui.adsabs.harvard.edu
Access-Control-Allow-Methods: DELETE, GET, OPTIONS, POST, PUT
Access-Control-Allow-Headers: Accept, Authorization, Content-Type, Orcid-Authorization, X-BB-Api-Client-Version, X-CSRFToken
Access-Control-Allow-Credentials: true
Vary: Origin
X-RateLimit-Limit: 5000
X-RateLimit-Remaining: 4823
X-RateLimit-Reset: 1595992737
Retry-After: 83896
Set-Cookie: session=.eJyrVopPK0otzlCyKikqTdVRis9MUbKqVlJIUrJS8gv3LY808i33DffL9qvKrvBzyTb2qwqt8Hfxy_TL9a30c_fKijQKNPB1cbVVqgXqLUgtyk3MS80rgZlWWpxaBDZRycjMxEipFgDRzSOy.Xx-i6A.UtqEVCdOAuRzdIAGbynY5Mjaz3g; Expires=Wed, 28-Jul-2021 10:00:40 GMT; HttpOnly; Path=/

{"responseHeader":{"status":400,"QTime":1,"params":{"q":"doi:10.1007/jhep07(2013)041","fl":"bibcode,citation_count","start":"0","internal_logging_params":"X-Amzn-Trace-Id=Root=1-5f1fa2e8-415e19707bffd2ffa6d5e046","rows":"10","wt":"json"}},"error":{"metadata":["error-class","org.apache.solr.common.SolrException","root-error-class","java.lang.Exception"],"msg":"org.apache.solr.search.SyntaxError: INVALID_SYNTAX_CANNOT_PARSE: Syntax Error, cannot parse doi:10.1007/jhep07(2013)041: The parser reported a syntax error, antlrqueryparser hates errors! ","code":400}}
""")

Textual documentation

Is it possible to provide the documentation also in plain text or markdown?

There are several reasons why I would prefer text:

  • The Jupyter viewer on GitHub often fails to display the content
  • It's much easier to search through the documentation with standard command line tools
  • I don't need to install Jupyter to see the documentation locally
  • I can easily see what changes with time looking at the git diffs
  • I can read the documentation with the editor I like, and not with an internet browser

In general, I don't see any benefit in having the documentation in the form of Jupyter notebooks, so I would love to have a more accessible way to read the docs.

open access property wrong

All articles from my query seem to be marked with the property "OPENACCESS", even those, which should not be, such as recent A&A papers which become open access only after 1 year and should therefore only marked as "EPRINT_OPENACCESS" in case they are on arXiv.

Example:

import json, urllib2, os
DEVKEY = os.environ['ADS_DEV_KEY']
DOI='10.1051/0004-6361/201424669'
URL = r'http://adslabs.org/adsabs/api/search/?q=doi:"'+DOI+'"&dev_key=' + DEVKEY
PUBS = json.load(urllib2.urlopen(URL))['results']['docs']
if 'OPENACCESS' in PUBS[0]['property']:
    print('article in open access')
elif 'EPRINT_OPENACCESS' in PUBS[0]['property']:
    print('article in green open access')
else:
    print('article NOT in open access')

Result:

article in open access

But the article is not open access.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.