Instagram API get location data on geotagged photo
Question: Is it possible to retrieve location data about a business or a venue a photo
was tagged at on `Instagram` using `python` and the `Instagram API`?

I have been using `access token` for my own account and have `Python
Instagram` installed.


Answer: You should query the image using the
[`get_media`](https://www.instagram.com/developer/endpoints/media/#get_media)
request to get its location details.

If the image was geo-tagged, the response will include the location details
like this:

    
    
    "location":  {
        "latitude": 40.417044464,
        "name": "Puerta del Sol Madrid",
        "longitude": -3.703540741,
        "id": 3002373
    }
    

To get this data with `python` use the [`Python-
Instagram`](https://github.com/Instagram/python-instagram) package and call
`api.media`:

    
    
    import instagram
    
    # Fill in access token here and image id
    access_token = ''
    media_id = ''
    api = instagram.client.InstagramAPI(access_token=access_token)
    res = api.media(media_id)
    print res.location
    
    # You should get a Location object with a latitude and a longitude point
    >> Location: 3002373 (Point: (40.417044464, -3.703540741))
    

