CrossRef / rest-api-doc

Documentation for Crossref's REST API. For questions or suggestions, see https://community.crossref.org/
Other
721 stars 270 forks source link

select=reference returns an empty list even when it isn't empty in the full listing #553

Open fergu opened 3 years ago

fergu commented 3 years ago

This may be user error, but I'm noticing that if I just want the list of papers referenced by a given paper that I cannot select just that part of the response even though the API indicates I should be able to. For example, selecting 3 random works that have references:

http://api.crossref.org/works?sample=3&filter=has-references:true

will return 3 papers who have a reference list. I could then ask it to just give me, I.E, the title, reference count, and the list of references:

http://api.crossref.org/works?sample=3&filter=has-references:true&select=title,references-count,reference

I'll get the first two fields, but reference will be empty. This can be done more repeatably by picking a DOI where you can look at the full response to see the references list is not empty. I.E:

http://api.crossref.org/works?filter=doi:10.1155/2018/3835783

and asking it just for the reference list gives an empty result

http://api.crossref.org/works?filter=doi:10.1155/2018/3835783?select=reference

I'm a bit of a novice when it comes to this type of API, so it's entirely possible my select parameter isn't structured correctly.

ppolischuk commented 3 years ago

Thanks for taking the time to file this, and I apologize for the confusion. This is a known bug: https://gitlab.com/crossref/issues/-/issues/511

We're still in code freeze as we work to migrate the REST API from Solr to Elasticsearch, but we hope to wrap that up in the next few months, after which we'll begin implementing high priority features and fixing bugs.

crumpled-acronym commented 3 years ago

Does this mean, the only option to get actual reference information is -- like 1,5 years ago -- to download everything and discard the other fields on the client side? What a waste for millions of DOIs...