Extract lat/lng from an Instagram photo via API
14,286
The get /media/{media-id} endpoint does return location information if it is available. Users can chose not to make it available, so not every image will have it.
This example will return an image with location information. You'll need to supply your own access token:
https://api.instagram.com/v1/media/432039264888987277_4513750
The response looks something like this:
{
"meta": {
"code": 200
},
"data": {
"attribution": null,
"tags": [],
"type": "image",
"location": {
"latitude": 48.8635,
"longitude": 2.301333333
},
"comments": {
"count": 0,
"data": []
},
..........
Author by
shaharsol
Updated on June 04, 2022Comments
-
shaharsol almost 2 years
By default, Instagram saves geo tags for all submitted photos. You can then search by location using
/media/search
. However, when I try to extract the geo tags from a specific pic using/media/media-id
, I always get"location": null
in the json response and no lat/lng pairs.Is this functionality simply blocked by Instagram? Is there another way to do it?