47

Is there an established way to, given a list of DOI identifiers, produce a .bib file containing the citation information?

1
  • 6
    Also note the inverse problem asked recently here Commented Dec 10, 2010 at 4:14

11 Answers 11

45

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)

2
  • 1
    Sometimes I get such responses: <html><body><h1>503 Service Unavailable</h1> No server is available to handle this request. </body></html>
    – math
    Commented Mar 12, 2014 at 16:56
  • For wget crowd: 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
    Commented Feb 18, 2019 at 13:26
13

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.

2
7

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!!

2
4

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.

0
4

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.

2
  • this does not work for me: OpenURL-specific logins are no longer valid.
    – Sebastian
    Commented Jun 21, 2012 at 8:01
  • 3
    this link appears to be broken...
    – Buck Thorn
    Commented Jul 29, 2013 at 17:52
3

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.

1
  • 2
    The link is broken
    – alfC
    Commented Oct 28, 2013 at 3:04
2

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.

1

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.

1

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.

1

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"))))
1
  • Related: This blog post defines a get-bibtex-from-doi function which works in a similar way (but does not call shell-command-to-string and "curl" but url-retrieve-synchronously).
    – ricma
    Commented Feb 3, 2022 at 17:47
1

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .