Request Header required to retrieve items in BibTeX format

I would like to retrieve items from crossref.org in BibTeX format. I cannot find any instructions in the documentation, but a post on this forum by @ coelias on the thread
CrossRef bibtex export & improving it - #5 by mrittman
says that one can do so by setting the Accept header to “application/x-bibtex”. However, when I do that I get a “Not acceptable” response. The full headers I am setting, as reported in the response I get, are:
headers: array:3 [▼
“Host” => array:1 [▼
0 => “api.crossref.org
]
“User-Agent” => array:1 [▼
0 => “text2bib (https://text2bib.org); mailto:martin.j.osborne@gmail.com
]
“Accept” => array:1 [▼
0 => “application/x-bibtex”
]
]

Has something changed since the post by @coelias?

1 Like

Hello. Thanks for the question, I’ll take a look at the documentation and make sure this is clearer.

You need to add ‘transform’ to the end of the query URL, so it will look something like:

http://api.crossref.org/works/10.1142/S0217984919300011/transform

Using the headers you have above, this should work.

1 Like

Another option using curl:

curl -D - -L -H "Accept: text/x-bibtex" "https://doi.org/10.1126/science.1157784"
1 Like

That works — thank you. I can’t find any mention in the documentation at all about generating output in BibTeX format. If there is none, it would definitely be good to add some!

Yes, we’ll be adding a bibtex example soon. Thanks again for reporting this.

There are some accept headers (content negotiation) that work for Crossref, DataCite and mEDRA: DOI Content Negotiation

1 Like