I suggest to not call the Crossref REST API directly, but instead use DOI content negotiation, as there are a total of 11 DOI registration agencies (although Crossref is by far the largest one). For example (using curl): curl -LH "Accept: application/x-bibtex" https://doi.org/10.1126/science.169.3946.635. More info at https://citation.crosscite.org/docs.html

Best, Martin

On Saturday, October 2, 2021 at 9:31:39 PM UTC+2 John MacFarlane wrote:


This might interest you:
https://github.com/pandoc/lua-filters/tree/master/doi2cite
Use DOIs as cite keys and automatically fetch the data.

Ilia Zaihcuk <zoi...@gmail.com> writes:

> Hi all,
>
> Is it possible, within the "pandoc'osphere", to fetch more metadata about a
> given citation from some online resource?
>
> Inspired by zbib.org (based on zotero <https://www.zotero.org/>). Given,
> for example, the simple search string "*Probability Neglect 2002*", the
> service returns as much as
>
> @article{sunstein_probability_2002,
> title = {Probability {Neglect}: {Emotions}, {Worst} {Cases}, and
> {Law}},
> volume = {112},
> issn = {00440094},
> shorttitle = {Probability {Neglect}},
> url = {https://www.jstor.org/stable/1562234?origin=crossref},
> doi = {10.2307/1562234},
> number = {1},
> urldate = {2021-10-02},
> journal = {The Yale Law Journal},
> author = {Sunstein, Cass R.},
> month = oct,
> year = {2002},
> pages = {61},
> }
>
> I see a lot of integrations with packages like citeproc-hs
> <https://hackage.haskell.org/package/citeproc-hs>, zotxt
> <https://github.com/egh/zotxt>, zotero-better-bibtex
> <https://retorque.re/zotero-better-bibtex/exporting/pandoc/>, etc., but all
> of them are talking primarily about managing and formatting a preexisting
> bibliography and I've seen *no* mention of anything about fetching *new
> data*.
>
> This can be very useful when citations in the source files are missing
> parts, or need to be converted into a format which requires more data (e.g.
> input is only <Name, Year, Title>, but output requires DOI).
>
> Best,
>
> Ilia
>
> --
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discus...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/86fd3cd3-ada6-406a-9aa6-7929aeb254fen%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/145362a0-b797-40f7-8610-9dd3b5e42f20n%40googlegroups.com.