Skip to content

docs: fix KeyError in batch async searches README example#88

Open
danishashko wants to merge 1 commit intoserpapi:masterfrom
danishashko:fix/readme-async-archive-example
Open

docs: fix KeyError in batch async searches README example#88
danishashko wants to merge 1 commit intoserpapi:masterfrom
danishashko:fix/readme-async-archive-example

Conversation

@danishashko
Copy link
Copy Markdown

Fixes #71

The Batch Asynchronous Searches example in the README fails with KeyError: 'search_metadata' because search.get_search_archive(search_id) is called on the original search object, which still has all the query params from the initial search loop (including q, location, async, etc.).

When those params are passed to the Search Archive API, it treats them as a new search request and returns an error response like:
{'error': 'You are using query q parameter on our Search Archive API...'}

Fix: use GoogleSearch({}).get_search_archive(search_id) instead, which is already the pattern shown correctly in the Search Archive API section of this same README.

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.

[Readme] Error in Batch Asynchronous Searches Example

1 participant