DEV Community

Cover image for ISBN to BibTeX - checks three sources before saying "not found
Sahil Kumar
Sahil Kumar

Posted on • Originally published at thelatexlab.com

ISBN to BibTeX - checks three sources before saying "not found

Most free ISBN tools query OpenLibrary alone, and OpenLibrary's coverage is genuinely uneven - contributor-maintained, so non-English titles, recent editions, and self-published books often just aren't there. This tries OpenLibrary's books API first, falls back to OpenLibrary's separate search index, then Google Books, and only reports "not found" if all three miss.

Two specific cleanups: both OpenLibrary and Google Books split subtitles into a separate field - "Artificial Intelligence: A Modern Approach" comes back as title="Artificial Intelligence" plus a standalone subtitle. @ book has no subtitle field, so converters reading only title silently drop "A Modern Approach." This joins them with a colon. Second, OpenLibrary's publish_date is genuinely inconsistent - "2023", "January 2023", "January 1, 2023", "2023-01-01" all show up - and passing that through verbatim gives year = {January 1, 2023}, which BibTeX accepts but every bibstyle renders wrong. This regex-extracts just the four-digit year. Same acronym brace-protection as the other tools (AI, HTML, SQL, CRISPR).

Honest gap: edition strings and individual volume numbers aren't extracted, since OpenLibrary's edition data is sparse and Google Books rarely separates it - add edition or volume by hand if needed. Works with ISBN-10 or ISBN-13, hyphenated or not, and there's a per-row type override if you're citing a chapter (@inbook/@incollection) instead of a whole book.

Link: thelatexlab.com/isbn-to-bibtex/

Top comments (0)