Page MenuHomePhabricator

ISBN requests hitting Library of Congress rate limits
Open, MediumPublic

Description

We use Library of Congress in Zotero to look up isbns. Temporary IP blocks are made if we exceed 10 requests in one minute.

They return a 200 without a machine readable cool-down for IP blocks, and the message is displayed in html.

https://lx2.loc.gov/sru/lcdb?operation=searchRetrieve&version=1.1&query=bath.ISBN=^9781912454785&maximumRecords=1

Compounding the issue is that translation-server doesn't handle the block correctly and chokes.

Short term:

Long-term

  • Rate limit ISBN requests and/or bot requests
  • Try to get a contract with WorldCat again
  • Disallow bot requests for isbns entirely

Details

Related Changes in Gerrit:
Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Update translators submodulerepos/mediawiki/services/zotero!26mvolzwork/mvolz/updatemain
Lower priority and improve open library translatorrepos/mediawiki/services/zotero-translators!16mvolzupdateolisbnmain
Add Open Library ISBN search translatorrepos/mediawiki/services/zotero-translators!15mvolzopenlibraryisbnmain
Customize query in GitLab

Event Timeline

Mvolz renamed this task from Library of Congress is likely rate limiting Zotero to Library of Congress is likely rate limiting us.Tue, Aug 18, 10:24 AM
Mvolz updated the task description. (Show Details)
Mvolz renamed this task from Library of Congress is likely rate limiting us to 100% failure for ISBN requests.Wed, Aug 19, 1:02 PM
Mvolz updated the task description. (Show Details)
Mvolz updated the task description. (Show Details)
Mvolz updated the task description. (Show Details)
Mvolz added subscribers: sjvipin, Samwalton9-WMF.
Mvolz triaged this task as High priority.Thu, Aug 20, 9:24 AM
Mvolz updated the task description. (Show Details)

Change #1329240 had a related patch set uploaded (by Mvolz; author: Mvolz):

[operations/deployment-charts@master] zotero: update version

https://gerrit.wikimedia.org/r/1329240

Quiddity subscribed.

Tech News draft-entry, which might need to be revised, as devs are still working on very-short-term potential solutions:

The ISBN lookup tools for generating citations are currently not working because of external service problems. Developers are working on solutions. [1]

Change #1329240 merged by jenkins-bot:

[operations/deployment-charts@master] zotero: update version

https://gerrit.wikimedia.org/r/1329240

Screenshot From 2026-08-26 16-22-14.png (516×411 px, 36 KB)

Since Zotero was deployed with the fixes, there's been a big improvement in isbn success ratio. Some degree of failures is expected because these open databases unfortunately aren't as comprehensive as some of the closed ones.

For the future: it's not super easy to tell if LoC is blocking us because logs in Zotero are not great.

Mvolz claimed this task.
Mvolz updated the task description. (Show Details)
Mvolz added a subscriber: dchan.

Resolving because it's not 100% anymore, but feel free to re-open and/or rename.

Nux subscribed.

The priority for the Open Library should be made so it is less important then most if not all national libraries.

National libraries and priorities (the lower value the more important it is):

Of which I am certain that Polish national library (PL-NL) works, and also serves data only for specific ISBNs (see function detectSearch(item)), and has better data then the Open Library.

I think OL should have a priority set to 101 to work as a fallback or at least change it to 99 to go after more specialised PL-NL.

See also:

@Nux curious whether you've hit any bad metadata accordingly?

LoC has priority 97 upstream: https://github.com/zotero/translators/blob/master/Library%20of%20Congress%20ISBN.js

I lowered it to 100 in these changes because we were hitting their rate limits because of this.

The rationale here is that OL has imputed the Library of Congress dumps that were released in 2016 and so in theory all of that metadata should be pretty good. https://loc.gov/cds/products/MDSConnect-books_all.html

So, in theory, by hitting OL first we're just getting the older LoC data, which leaves us some spare requests to get an ISBN from 2016 onward. However I guess if OL contains 2016 onward metadata that's messy, this is potentially worse.

We can potentially lower OL below the other libraries and lower LoC even further than 100, but I think this would require some more research about rate limits for these libraries. OL is safely within range within our typical usage, these other libraries may not be, so I think that'd have to be investigated before raising priority.

Mvolz renamed this task from 100% failure for ISBN requests to ISBN requests hitting Library of Congress rate limits.Tue, Sep 1, 7:52 AM
Mvolz lowered the priority of this task from High to Medium.

LoC has priority 97 upstream: https://github.com/zotero/translators/blob/master/Library%20of%20Congress%20ISBN.js

Oh, right, I missed that. Even so, not hitting LoC for a Polish ISBN would've hit the National Library of Poland. Now it'll hit OL, as OL has bibliographic descriptions of books in various languages, including Polish.

However I guess if OL contains 2016 onward metadata that's messy, this is potentially worse.

OpenLibrary contains metadata from Amazon resellers (uneven, often poor, quality) and Better World Books (terrible quality), as well as user contributed metadata. Booksellers have fundamentally different goals and quality standards than library catalogers.

Thank you. I appreciate the change :-). As long as WebArchive doesn't get defunded this is a good change :-)

Change #1341867 had a related patch set uploaded (by Mvolz; author: Mvolz):

[operations/deployment-charts@master] zotero: update to latest

https://gerrit.wikimedia.org/r/1341867