Skip to content

fix: add optional Google Books API key to resolve rate-limited metadata fetching#1380

Open
seanjohnite wants to merge 1 commit into
crocodilestick:mainfrom
seanjohnite:fix/google-api-key
Open

fix: add optional Google Books API key to resolve rate-limited metadata fetching#1380
seanjohnite wants to merge 1 commit into
crocodilestick:mainfrom
seanjohnite:fix/google-api-key

Conversation

@seanjohnite
Copy link
Copy Markdown

@seanjohnite seanjohnite commented May 29, 2026

Google aggressively rate-limits unauthenticated requests to the Books API, causing empty results for many users. This adds a global config field for a Google Books API key (Admin → Configuration) that is appended to search requests when set, restoring reliable metadata results.

Example log: [2026-05-29 01:08:17,501] WARN {cps.metadata_provider.google:45} 429 Client Error: Too Many Requests for url: https://www.googleapis.com/books/v1/volumes?q=Harry+Potter

  • config_sql.py: add config_google_api_key column (auto-migrated on startup)
  • admin.py: persist the new field on config save
  • config_edit.html: add API key input with help text near Hardcover/Goodreads
  • google.py: append &key= to search URL when key is configured
  • tests: add unit tests covering key present, absent, and empty cases

Fixes #993

Screenshot 2026-05-28 at 21-26-35 Calibre-Web Automated edit metadata Screenshot 2026-05-28 at 21-28-28 Calibre-Web Automated Basic Configuration

…ta searches

Google aggressively rate-limits unauthenticated requests to the Books API,
causing empty results for many users. This adds a global config field for
a Google Books API key (Admin → Configuration) that is appended to search
requests when set, restoring reliable metadata results.

- config_sql.py: add config_google_api_key column (auto-migrated on startup)
- admin.py: persist the new field on config save
- config_edit.html: add API key input with help text near Hardcover/Goodreads
- google.py: append &key= to search URL when key is configured
- tests: add unit tests covering key present, absent, and empty cases

Fixes crocodilestick#993
@seanjohnite seanjohnite force-pushed the fix/google-api-key branch from f6e50cf to 9ac5ecc Compare May 29, 2026 01:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Google metadata search returns no results

1 participant