Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Readme] Error in Batch Asynchronous Searches Example #71

Open
schaferyan opened this issue Sep 10, 2024 · 0 comments
Open

[Readme] Error in Batch Asynchronous Searches Example #71

schaferyan opened this issue Sep 10, 2024 · 0 comments

Comments

@schaferyan
Copy link

Currently, the example provided in the README for Batch Asynchronous Searches fails with KeyError: 'search_metadata'.

The reason for this is that the search object used to perform the initial searches is used again to call the Search Archive API without removing the previous parameters. This causes the Search Archive API to return a {'error': 'You are using query q parameter on our Search Archive API. To make a new search, use: https://serpapi.com/search.json?q=coffee'} response.

This is fixed by replacing search_archived = search.get_search_archive(search_id) with search_archived = GoogleSearch({}).get_search_archive(search_id).

We can correct this in the README to help prevent confusion for users attempting to follow the example.

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

No branches or pull requests

1 participant