[Python] 404 error when get request made to google places API using Python

Discussão em 'Python' iniciado por Stack, Junho 5, 2025.

  1. Stack

    Stack Membro Participativo

    Im using python to do access the google places API. I already made an account and setup a project but for some reason when I do this request it always returns 404 error. Can someone help me with what inm doing wrong?


    url = "https://places.googleapis.com/v1/places/GyuEmsRBfy61i59si0?fields=addressComponents&key= MY API KEY"


    user_loc = {
    "includedTypes": ["grocery_store"],
    "maxResultCount": 10,
    "locationRestriction": {
    "circle": {
    "center": {
    "latitude": 43.646500,
    "longitude": -79.389577},
    "radius": 500.0
    }
    }
    }

    location_requests = requests.post(url, json = user_loc)

    print(location_requests.status_code)

    Continue reading...

Compartilhe esta Página