[Readme] Error in Batch Asynchronous Searches Example

Open
#71 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
50/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
python
Domain
documentation

Research direction

Open the README and locate the Batch Asynchronous Searches example. Update the Search Archive call as described, then run the example or its relevant documentation check to confirm it no longer raises KeyError: 'search_metadata'.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Python
Stars
756
Forks
118
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from serpapi/google-search-results-python

All issues in serpapi/google-search-results-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.