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 queryqparameter 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.
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
qparameter 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)
withsearch_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.