I am trying to save the output from my API call to a JSON file so that i can parse it properly. I am getting all sorts of errors.
Below is my code:
import os
import json
import pandas as pd
import serpapi
from dotenv import load_dotenv
load_dotenv()
api_key = os.getenv(‘SERPAPI_KEY’)
client = serpapi.Client(api_key=api_key)
results = client.search({‘engine’: ‘google_maps_reviews’,’type’: ‘search’,’place_id’: ‘ChIJidRKt32YVogRN6fEPG9Kuho’})
data = json.loads(results.json)
Jose Nunez is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.