How to use the google place detail API to return the website from the backend in python?

Viewed 13

I am trying to use the google place detail api - https://developers.google.com/maps/documentation/places/web-service/details

I have got this error below

data ['{\n   "error_message" : "Error while parsing \'fields\' parameter: Unsupported field name \'STRATA\'. ",\n   "html_attributions" : [],\n   "status" : "INVALID_REQUEST"\n}\n']

I think I am using the wrong syntax in the URL.

async def get_data(session, api_key):

    formatted_address = "STRATA TECHNOLOGY PARTNERS LLP WHITE CHIMNEYS ELM GROVE ROAD COBHAM SURREY KT11 3HB"

    async with session.get(rf"https://maps.googleapis.com/maps/api/place/details/json?place_id={place_id}&fields={formatted_address}&key={api_key}") as resp:
        return await resp.text()
0 Answers
Related