Is there an established way to, given a list of DOI identifiers, produce a .bib file containing the citation information?
-
6Also note the inverse problem asked recently here – Will Robertson Dec 10 '10 at 04:14
11 Answers
Crossref has just enabled content-negotiation on their API, where they are able to generate bibtex. Here's an example from their blog
curl -LH "Accept: text/bibliography; style=bibtex" http://dx.doi.org/10.1038/nrd842
here's how you'd do it in Ruby
open("http://dx.doi.org/10.1038/nrd842","Accept" => "text/bibliography; style=bibtex"){|f| f.each {|line| print line}}
(from StackOverflow)
- 553
-
1Sometimes I get such responses: `
503 Service Unavailable
No server is available to handle this request. ` – math Mar 12 '14 at 16:56 -
For
wgetcrowd:wget -qO- --header "Accept: text/bibliography; style=bibtex" http://dx.doi.org/10.1038/nrd842. This will print it to stdout. Remove the-qO-to store it in file. – Pouya Feb 18 '19 at 13:26
There's also doi-to-bibtex from betterbib (a pet project of mine),
betterbib doi-to-bibtex 10.1038/nrd842
@article{atkins2002,
author = {Atkins, Joshua H. and Gershell, Leland J.},
doi = {10.1038/nrd842},
number = {7},
pages = {491-492},
source = {Crossref},
url = {http://dx.doi.org/10.1038/nrd842},
volume = {1},
journal = {Nat Rev Drug Discov},
publisher = {Springer Science and Business Media LLC},
title = {Selective anticancer drugs},
issn = {1474-1776, 1474-1784},
year = {2002},
month = jul,
}
It's a bit more consistent than Crossref's API endpoint, for example in the conversion of the month item or the capitalization in titles.
- 4,967
I stumbled over this issue and it annoyed me as well so I invested some time and came up with a VEEERRRYYY simple little webtool:
http://doi-to-bibtex.herokuapp.com
I might invest some more time at some point, but got now it just WORKS!!
- 87
It is possible to obtain the bibliographic information associated with a doi in XML format (except the abstract) via a web query to crossref.org. I've have been following instructions at
http://labs.crossref.org/site/quick_and_dirty_api_guide.html
and the service works as advertised.
- 65
-
this does not work for me: OpenURL-specific logins are no longer valid. – Sebastian Jun 21 '12 at 08:01
-
3
Unfortunately, there is no any tools trying to dealing with this. I think it's nearly impossible. Because DOI system is similar to URL but more strictly. It's aiming to establish a unique permanent link system, which is not limited to published materials. Although it is used by many publishers.
Technically, from a DOI number, what we can get directly is only a redirect link, whose content can be organized in any style with any codes. To recognize them correctly, we need something like import filters of Zotero but more.
- 895
Hi the proper link to "doi2bibtex" is this url:
http://code.google.com/p/ocefpaf-python/source/browse/ocefpaf/doi2bibtex.py
The one list here is just the "wrapper" to the script.
In the end, this script is just an ugly hack to get the ADS database (with some prototype to other databases and google scholar.) Anyone interested in taking this forward is welcome, since I cannot afford the time for this project anymore.
I've found something of a solution. Mind you it's not brilliant. I recently had this problem and was quite frustrated with it.
I've been using this method (implemented in java) to extract the .bib from a doi using the crossref.org website. They have a query function which I've been abusing with cURL in order to extract the information from the xml returned. (It's not the best but it is a solution). N.B. crossref fails to look up the title. No idea why. I'll upload the Jar when I'm done.
- 3,117
- 9
- 29
- 33
Another crossref lookup (in python) -- even with titles! :)
different journals use different fields, this script works now with the journals i'm usually referencing to.
in order to produce a bibtex file, save the script e.g. as doi2bib.py and run python doi2bibtex.py DOI1 DOI2 DOI3 etc > mybibtexfile.bib (under linux; there should be an equivalent possibility for windows)
There's a Ruby "translation" available here as well.
- 553
- 1,213
BibSonomy is a website for reference management, similar to CiteULike. BibSonomy allows posting publications via DOI, afterwards you can download your complete library as a .bib file. If the DOI is displayed on a webpage, you can highlight it and post it with a bookmarklet.
- 12,381
I used the answer of Stian Håklev to write a small emacs function which retrieves the bibtex from a doi. Just call M-x doi-to-bib (adjust "~/bib/ref.bib" to the location of your main bibtex file).
(defun string-starts-with (s arg)
"returns non-nil if string S starts with ARG. Else nil."
(cond ((>= (length s) (length arg))
(string-equal (substring s 0 (length arg)) arg))
(t nil)))
(defun doi-to-bib (doi)
(interactive "sEnter the doi to expand to bibtex via crossref: ")
(with-current-buffer (find-file-noselect (expand-file-name "~/bib/ref.bib"))
(goto-char (point-max))
; doi:10.1016/j.egypro.2014.12.316 to http://dx.doi.org/10.1016/j.egypro.2014.12.316
(when (string-starts-with doi "doi:")
(setq doi (concat "http://dx.doi.org/" (string-remove-prefix "doi:" doi))))
(insert (concat "\n\n"
(string-trim
(shell-command-to-string
(concat
"curl -sLH \"Accept: text/bibliography; style=bibtex\" "
doi)))
"\n\n"))))
-
Related: This blog post defines a get-bibtex-from-doi function which works in a similar way (but does not call
shell-command-to-stringand"curl"buturl-retrieve-synchronously). – ricma Feb 03 '22 at 17:47
Just found this npm package:
https://github.com/davidagraf/doi2bib2
https://www.doi2bib.org/
A simple web interface that, when entered a digital object identifier (DOI), returns the BibTeX entry. They retrieve citation records directly from publishers through public interfaces provided by The International DOI Foundation and Crossref.
- 12,381