Get metadata from DOI

老子叫甜甜 提交于 2019-12-02 17:29:19

curl -LH "Accept: text/bibliography; style=bibtex" http://dx.doi.org/10.1038/nrd842

argentpepper

Section 5.4.1 Content Negotiation of the DOI Handbook documents states, "Content negotiation is being implemented by DOI Registration Agencies for their DOI names, specifically to offer value-added metadata representations for users." According to Section 4 Supported Content Types of the DOI Content Negotiation documentation for http://crosscite.org, "Currently three DOI registration agencies have implemented content negotation for their DOIs: CrossRef, DataCite and mEDRA." The list of supported formats (which depends on the registration agency) includes both BibTeX via Accept: application/x-bibtex (this is the approach used by http://doi2bib.org) and formatted bibliography entry via Accept: text/bibliography (this is the approach suggested by @anumi above). When using the latter header, you must specify the style=bibtex media type parameter.

The two relevant mimetypes provide slightly different representations. A request to GET http://dx.doi.org/10.1038/nrd842 with Accept: application/x-bibtex yields the response

@article{Atkins_2002,
    doi = {10.1038/nrd842},
    url = {http://dx.doi.org/10.1038/nrd842},
    year = 2002,
    month = {jul},
    publisher = {Springer Nature},
    volume = {1},
    number = {7},
    pages = {491--492},
    author = {Joshua H. Atkins and Leland J. Gershell},
    title = {From the analyst{\textquotesingle}s couch: Selective anticancer drugs},
    journal = {Nature Reviews Drug Discovery}
}

and with Accept: text/bibliography; style=bibtex

@article{Atkins_2002, title={From the analyst’s couch: Selective anticancer drugs}, volume={1}, ISSN={1474-1784}, url={http://dx.doi.org/10.1038/nrd842}, DOI={10.1038/nrd842}, number={7}, journal={Nature Reviews Drug Discovery}, publisher={Springer Nature}, author={Atkins, Joshua H. and Gershell, Leland J.}, year={2002}, month={Jul}, pages={491–492}}

Take a look at how these guys implemented it: www.doi2bib.org.

What I did in one of my projects:

  • looked at their url request structure: http://www.doi2bib.org/doi2bib + ?id= + {your doi here}.
  • then used their... well API to get the data (e.g. http://www.doi2bib.org/doi2bib?id=10.1016%2Fj.actpsy.2016.09.007) and the response is:
    • @article{Leinen_2016, doi = {10.1016/j.actpsy.2016.09.007}, url = {http://dx.doi.org/10.1016/j.actpsy.2016.09.007}, year = 2016, month = {nov}, publisher = {Elsevier {BV}}, volume = {171}, pages = {36--46}, author = {Peter Leinen and Stefan Panzer and Charles H. Shea}, title = {Hemispheric asymmetries of a motor memory in a recognition test after learning a movement sequence}, journal = {Acta Psychologica} }
  • then you can parse it the way you want.

This helped me to get what I needed done. However, the nicest way would be to take a look at their GitHub repository and try to build your own.

Hope it helps!

CrossRef has an API, which you can use with an API key that can be obtained free of charge from http://www.crossref.org/requestaccount/.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!