texworld / betterbib

:green_book: Command-line tools for bibliographies.
816 stars 42 forks source link

PubMed as data source #235

Closed anntzer closed 1 year ago

anntzer commented 2 years ago

Similarly to https://github.com/nschloe/betterbib/issues/102 (arxiv), this is a request to add pubmed (https://pubmed.ncbi.nlm.nih.gov/) as data source. (PubMed, a widely used bibliography database in the life sciences, is not to be confused with the similarly named PubMed Central, a repository of open access articles, see https://en.wikipedia.org/wiki/PubMed vs https://en.wikipedia.org/wiki/PubMed_Central).

Metadata entries can be more accurate on PubMed that on Crossref, see e.g. https://pubmed.ncbi.nlm.nih.gov/9305848/?format=pubmed vs https://api.crossref.org/v1/works/10.1038/38532 (the first author name is "Nédélec", not "Ndlec").

nschloe commented 2 years ago

Is there a search API for PubMed?

anntzer commented 2 years ago

Apparently there is, see e.g. https://stackoverflow.com/questions/32054964/how-to-use-the-pubmed-api-to-search-for-an-article-with-an-exact-title (https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esearch.fcgi?db=pubmed&retmode=json&retmax=1000&term=The%20cost-effectiveness%20of%20mirtazapine%20versus%20paroxetine%20in%20treating%20people%20with%20depression%20in%20primary%20care&field=title and https://eutils.ncbi.nlm.nih.gov/entrez/eutils/esummary.fcgi?db=pubmed&retmode=json&retmax=1000&id=15107654) and also https://www.ncbi.nlm.nih.gov/books/NBK25501/, https://biopython.org/docs/dev/api/Bio.Entrez.html (for example). (Sorry for just dumping these links in unstructured form...)

nschloe commented 1 year ago

Fixed now! :tada: I've tested with a bunch of articles, but your mileage may still vary. Let me know if you run into any trouble!