Email or username:

Password:

Forgot your password?
Ale berada di Kuala Lumpur!

DOI='10.1145/3356903'
curl "api.crossref.org/works/${DOI}" \
| jq -r '.message.abstract' \
| { \
echo '<article xmlns:mml="w3.org/1998/Math/MathML" dtd-version="1.2"><body>'
cat
echo '</body></article>'
} \
| pandoc --from jats --to commonmark

# Given DOI, get the article abstract (if it is available)

#oneliner #shell #cli

2 comments
Ale berada di Kuala Lumpur!

api.semanticscholar.org/ is easier for this purpose: api.semanticscholar.org/graph/

But where's the fun in that! Also, it doesn't include all abstracts, although it has some that CrossRef doesn't (e. g. some medical ones, which they probably get from PubMed)

Ale berada di Kuala Lumpur!

Whoa!

curl -LH "Accept:application/json" dx.doi.org/10.1145/3356903 | jq .abstract

Sadly, some articles are missing abstracts here as well.

One more fun thing is that it can produce BibTeX:

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

Go Up