CrossRef / rest-api-doc

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

api query with DOI not working #543

Closed corrad82-4s closed 3 years ago

corrad82-4s commented 3 years ago

When a query is performed against api platform, with a given DOI, response contains a lot of items, most of them not related to the query.

For example, following query https://api.crossref.org/works?query=%2C10.1111%2Fjfbc.13557

should return a single result, while about 400K items are returned. If a lookup with same DOI is performed on crossref web site, only the item with searched DOI is correctly returned.

weirdf0x commented 3 years ago

http://api.crossref.org/works?filter=doi:10.1111/jfbc.13557 or http://api.crossref.org/works/10.1111/jfbc.13557 works fine if you need metadata for a specific DOI.

abollini commented 3 years ago

hi @danielopitz thanks for taking time to look to our request. The issue is that we don't know in advance that the input will be a DOI. We are implementing an integration that allow a researcher to just enter a query to search for (her) publications to import in an Institutional Repository to save time in metadata input. We can of course try to detect on our side when an input is a DOI but we were wondering if it will be not better if such automatic detection occur on your side (as I guess this is a need shared by many API clients). If the query parameter could support some syntax such as specifying the index to use or boolean operator we can provide hints for the researchers to write better query.

weirdf0x commented 3 years ago

To clarify: I'm not affiliated with Crossref.

I tried out some things and none of them worked. It is rather easy to detect a DOI, so that would be the solution I would implement. There is a possibility to query on a field, but not on the DOI field: https://github.com/CrossRef/rest-api-doc#queries I don't think it would make much sense, you can just http://api.crossref.org/works/, if it is a valid DOI you get a result, if not - you don't.

pdavis8 commented 3 years ago

I am closing this ticket here as it looks like it has been resolved. If there are more issues can you log them here please: https://gitlab.com/crossref/issues/-/issues

Thanks you