Home » Php » php – How to fetch a Book Title from an ISBN number?

php – How to fetch a Book Title from an ISBN number?

Posted by: admin April 23, 2020 Leave a comment


I am planning on creating a small website for my personal book collection. To automate the process a little bit, I would like to create the following functionality:

The website will ask me for the ISBN number of the book and will then automatically fetch the title and add it to my database.

Although I am mainly interested in doing this in php, I also have some Java implementation ideas for this. I believe it could also help if the answer was as much language-agnostic as possible.

How to&Answers:

This is the LibraryThing founder. We have nothing to offer here, so I hope my comments will not seem self-serving.

First, the comment about Amazon, ASINs and ISBN numbers is wrong in a number of ways. In almost every circumstance where a book has an ISBN, the ASIN and the ISBN are the same. ISBNs are not now 13 digits. Rather, ISBNs can be either 10 or 13. Ten-digit ISBNs can be expressed as 13-digit ones starting with 978, which means every ISBN currently in existence has both a 10- and a 13-digit form. There are all sorts of libraries available for converting between ISBN10 and ISBN13. Basically, you add 978 to the front and recalculate the checksum digit at the end.

ISBN13 was invented because publishers were running out of ISBNs. In the near future, when 979-based ISBN13s start being used, they will not have an ISBN10 equivalent. To my knowledge, there are no published books with 979-based ISBNs, but they are coming soon. Anyway, the long and short of it is that Amazon uses the ISBN10 form for all 978 ISBN10s. In any case, whether or not Amazon uses ten or thirteen-digit ASINs, you can search Amazon by either just fine.

Personally, I wouldn’t put ISBN DB at the top of your list. ISBN DB mines from a number of sources, but it’s not as comprehensive as Amazon or Google. Rather, I’d look into Amazon—including the various international Amazons—and then the new Google Book Data API and, after that, the OpenLibrary API. For non-English books, there are other options, like Ozone for Russian books.

If you care about the highest-quality data, or if you have any books published before about 1970, you will want to look into data from libraries, available by Z39.50 protocol and usually in MARC format, or, with a few libraries in Dublin Core, using the SRU/SRW protocol. MARC format is, to a modern programmer, pretty strange stuff. But, once you get it, it’s also better data and includes useful fields like the LCCN, DDC, LCC, and LCSH.

LibraryThing runs off a homemade Python library that queries some 680 libraries and converts the many flavors of MARC into Amazon-compatible XML, with extras. We are currently reluctant to release the code, but maybe releasing a service soon.


Google has it’s own API for Google Books that let’s you query the Google Book database easily. The protocol is JSON based and you can view the technical information about it here.

You essentially just have to request the following URL :


This will return you the information about the book in a JSON format.


Check out ISBN DB API. It’s a simple REST-based web service. Haven’t tried it myself, but a friend has had successful experiences with it.

It’ll give you book title, author information, and depending on the book, number of other details you can use.


Try https://gumroad.com/l/RKxO

I purchased this database about 3 weeks ago for a book citation app I’m making. I haven’t had any quality problems and virtually any book I scanned was found. The only problem is that they provide the file in CSV and I had to convert 20 million lines which took me almost an hour! Also, the monthly updates are not delta and the entire database is sent which works for me but might be some work for others.


I haven’t tried it, but take a look at isbndb

API Description: Introduction

ISBNdb.com’s remote access application programming interface (API) is designed to allow other websites and standalone applications use the vast collection of data collected by ISBNdb.com since 2003. As of this writing, in July 2005, the data includes nearly 1,800,000 books; almost 3,000,000 million library records; close to a million subjects; hundreds of thousands of author and publisher records parsed out of library data; more than 10,000,000 records of actual and historic prices.

Some ideas of how the API can be used include:

- Cataloguing home book collections
- Building and verifying bookstores' inventories
- Empowering forums and online communities with more useful book references
- Automated cross-merchant price lookups over messaging devices or phones

Using the API you can look up information by keywords, by ISBN, by authors or publishers, etc. In most situations the API is fast enough to be used in interactive applications.

The data is heavily cross-linked — starting at a book you can retrieve information about its authors, then other books of these authors, then their publishers, etc.

The API is primarily intended for use by programmers. The interface strives to be platform and programming language independent by employing open standard protocols and message formats.


Although the other answers are correct, this one explains the process in a little more detail. This one uses the GOOGLE BOOKS API.


All you need to do is

1.Create an appropriate HTTP request

2.Send it and Receive the JSON object containing detail about the book

3.Extract the title from the received information

The response you get is in JSON. The code given on the above site is for NODE.js but I’m sure it won’t be difficult to reproduce that in PHP(or any other language for that matter).


To obtain data for given ISBN number you need to interact with some online service like isbndb.
One of the best sources for bibliographic information is Amazon web service. It provides you with all bibliographic info + book cover.


You might want to look into LibraryThing, it has an API that would do what you want and they handle things like mapping multiple ISBNs for different editions of a single “work”.


As an alternative to isbndb (which seems like the perfect answer) I had the impression that you could pass an ISBN into an Amazon product URL to go straight to the Amazon page for the book. While this doesn’t programmatically return the book title, it might have been a useful extra feature in case you wanted to link to Amazon user reviews from your database.

However, this link appears to shows that I was wrong. Actually what Amazon uses is the ASIN number and while this used to be the same as 10-digit ISBN numbers, those are no longer the only kind – ISBNs now have 13 digits (though there is a straight conversion from the old 10-digit type).

But more usefully, the same link does talk about the Amazon API which can convert from ISBN to ASIN and is likely to also let you look up titles and other information. It is primarily aimed at Amazon affiliates, but no doubt it could do the job if for some reason isbndb does not.

Edit: Tim Spalding above points out a few practical facts about ISBNs – I was slightly too pessimistic in assuming that ASINs would not correspond any more.


You may also try this database: http://www.usabledatabases.com/database/books-isbn-covers/

It’s got more books / ISBN than most web services you can currently find on the web. But it’s probably an overkill for your small site.