It's not TeX, but I use this python 3 code to do something like this:
from isbnlib import meta
from isbnlib.registry import bibformatters
import sys
import urllib.request
from urllib.error import HTTPError
import time
### PARA DOI
#BASE_URL = 'http://dx.doi.org/'
BASE_URL = 'https://www.doi.org/'
ListaDOI = ['10.1119/1.5124814',
'10.1103/PhysRevB.100.245121',
'10.1103/PhysRevB.100.224507',
'10.1103/PhysRevE.100.052303',
'10.1103/PhysRevFluids.4.124002',
'10.1103/PhysRevD.100.126011',
'10.1103/PhysRevA.100.052322']
### PARA ISBN
SERVICE = 'openl'
getInfoISBN = bibformatters['bibtex']
ListaISBN = []
#timestamp=time.strftime("%d-%m-%Y-%H%M%S")
timestamp=time.strftime("%d-%m-%Y-%H")
filename='bibliography-'+timestamp+'.txt'
g=open(filename,'a')
for doi in ListaDOI:
url = BASE_URL + doi
req = urllib.request.Request(url)
req.add_header('Accept', 'application/x-bibtex')
time.sleep(2)
try:
with urllib.request.urlopen(req) as f:
bibtexDOI = f.read().decode()
print(bibtexDOI)
g.write('\n' + bibtexDOI + '\n\n')
except HTTPError as e:
if e.code == 404:
print('\n DOI {} nao encontrado. DOI not found.\n'.format(doi))
g.write('DOI: {}'.format(doi)+' não encontrado. Not found.\n\n')
else:
print('Serviço indisponível. Service unavailable.')
sys.exit(1)
for isbn in ListaISBN:
try:
bibtexISBN = getInfoISBN(meta(isbn, SERVICE))
print(bibtexISBN)
g.write('\n' + bibtexISBN + '\n\n')
except:
print('\n ISBN {} nao encontrado. ISBN not found.\n'.format(isbn))
g.write('ISBN: {}'.format(isbn)+' não encontrado. Not found.\n\n')
g.close()
It uses the site http://dx.doi.org/ to get the information. So, you list the doi number in 'ListaDOI' (how many you need) and just run with your python. It will show the bib entry and save it into a 'bibliography.txt'.
Edit: added isbn search. It uses a specific python lib, the isbnlib. The same way you put isbn into 'ListaISBN', like in 'ListaDOI'.
.bibentries from the web are notoriously unreliable. But there are some reasonable ways to get.bibentries from DOIs. See How can I find a bibtex entry for an article? (duplicate?) – Alan Munn Dec 12 '19 at 16:10.bibentries from the web you may want to have a look at https://tex.stackexchange.com/q/386053/35864. You have tagged your question withbiblatex. Is there anything specifically aboutbiblatex(the citation/bibliography package: https://www.ctan.org/pkg/biblatex) you would like to see addressed, or are you only asking about generic.bibfiles? – moewe Dec 12 '19 at 16:46