[Bug 43592] New: Google Books API quota error
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43592 Bug ID: 43592 Summary: Google Books API quota error Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: amitddng135@gmail.com QA Contact: testopia@bugs.koha-community.org Target Milestone: --- Requesting Google Books data via [https://www.googleapis.com/books/v1/volumes?q=9781492180746](https://www.googleapis.com/books/v1/volumes?q=9781492180746) fails with a quota error (HTTP 429 Too Many Requests) because Google requires an API key for reliable, unthrottled requests. Furthermore, querying raw numbers without the isbn: qualifier fails to restrict results precisely to ISBN matches. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43592 Amit Gupta <amitddng135@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43592 Amit Gupta <amitddng135@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |amitddng135@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43592 --- Comment #1 from Amit Gupta <amitddng135@gmail.com> --- Created attachment 206499 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206499&action=edit Error Google book -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43592 Amit Gupta <amitddng135@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Sponsorship status|--- |Sponsored Comma delimited| |Amit Gupta list of Sponsors| |(amit.gupta@informaticsglob | |al.ai) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43592 Amit Gupta <amitddng135@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43592 Amit Gupta <amitddng135@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Google Books API quota |Google Books OPAC |error |suggestion autofill fails | |with quota error due to | |missing API key and query | |format -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43592 --- Comment #2 from Amit Gupta <amitddng135@gmail.com> --- Created attachment 206500 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206500&action=edit Bug 43592: Google Books OPAC suggestion autofill fails with quota error due to missing API key and query format Querying the Google Books API without an API key using the endpoint format 'https://www.googleapis.com/books/v1/volumes?q=<isbn>' triggers 429 quota errors because unauthenticated IP-based requests are heavily throttled. Additionally, omitting the 'isbn:' search qualifier can fail to return exact ISBN matches. This patch updates autofill.js 1. Explicitly prepend 'isbn:' to the query string (q=isbn:<clean_isbn>). 2. Pass the 'GoogleBooksApiKey' system preference to append '&key=<apiKey>'. 3. Clean and sanitize ISBN input values. Test Plan: 1. Log in to the Koha Staff Interface as an administrator. 2. Go to Administration -> System preferences and enable OPACSuggestionAutoFill. 3. Log in to the OPAC and go to the Purchase Suggestion page (opac-suggestions.pl?op=add). 4. Enter a valid ISBN (e.g., 9781492180746) in the ISBN field and click "Search Google Books". 5. No result populates 6. Apply the patch. 7. Go to Administration -> System preferences in the Staff Interface. 8. Search for GoogleBooksApiKey and enter a valid Google Books API key. 9. Return to the OPAC Purchase Suggestion page, enter the ISBN, and click "Search Google Books". 10. Verify that the book details (Title, Author, Publisher) populate correctly into the form. Added new System preference: GoogleBooksApiKey -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43592 Amit Gupta <amitddng135@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43592 --- Comment #3 from Amit Gupta <amitddng135@gmail.com> --- Generate Google API key: 1.Open the Google Cloud Console: Google Cloud Console – Credentials 2. Select your Google Cloud Project. You can create a new project if you don't already have one. 3. Go to APIs & Services → Library. 4. Search for Books API and enable it. 5. Go to APIs & Services → Credentials. Click Create Credentials → API key. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43592 Amit Gupta <amitddng135@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amit.gupta@informaticsgloba | |l.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43592 --- Comment #4 from Amit Gupta <amitddng135@gmail.com> --- Created attachment 206514 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206514&action=edit Bug 43592: Add GoogleBooksApiKey system preference Add a new system preference GoogleBooksApiKey used to fetch book data from Google Books. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43592 Amit Gupta <amitddng135@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #206514|0 |1 is obsolete| | --- Comment #5 from Amit Gupta <amitddng135@gmail.com> --- Created attachment 206515 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206515&action=edit Bug 43592: Add GoogleBooksApiKey system preference Add a new system preference GoogleBooksApiKey used to fetch book data from Google Books. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org