Match BHL link to PageID

The book reader used by BHL to display pages rewrites the URL your web browser displays as you navigate through the book. Hence two people looking at the same page may have different URLs for that page. If we take a page link of the form https://www.biodiversitylibrary.org/page/nnn as the definitive link for a BHL page, then this tools aims to convert browser URLs to this definitive link.

A further complication is that the book reader can display one or more pages. Typically the book reader displays a single page, but some people prefer two pages side-by-side. The BHL URL stores this information in a mode parameter, e.g. mode/1up is one page. However, if we have more than one page on screen, which page did the user intend to link too? By default this tool will return the PageIDs of the two pages. If you also supply a "target string", such as a taxonomic name, then it will attempt to find that string in the two pages. If it is only present on one page, the PageID for that page is returned.

A good example is http://www.biodiversitylibrary.org/item/36660#page/306/mode/2up (from NHM Butterflies and Moths of the World) and https://www.biodiversitylibrary.org/page/9340414 (from Afromoths.net) which are two URLs given for the same genus Acharana Moore, 1885 on the same page in the same book.

To use as an API simply GET the site URL with the BHL link as the parameter "url" (URL encoded), and the optional string to match as "target", e.g.

?url=http://www.biodiversitylibrary.org/item/36660#page/306/mode/2up&target=Acharana

or POST a JSON document of the form { "url": "browser link to BHL page", "target": "string to match" }. The API will return results as JSON.

Enter target text to match, such as taxon name (optional).