Вопрос

I have instagram-python installed and I have an oauth token from instagram api and I am trying to grab a list of all of the location data (latitude and longitude) from instagram photos posted in brussels belgium. What is the best way to do this?

Brussels is lat: 50.85396 and long: 4.34150 and I would like to search for at least a 2km radius.

I use https://api.instagram.com/v1/tags/search?q=brussels&access_token=[my access token] and it returns:

{"meta":{"code":200},"data":[{"media_count":387831,"name":"brussels"}, is it possible to access the data in that media_count? I want to grab as much location data as I can, I do not particularly care about the actual pictures

Thanks

Это было полезно?

Решение

You have to use the media/search API to get geolocation information around a geo location:

https://api.instagram.com/v1/media/search?lat=50.85396&lng=4.34150&distance=2000&access_token=ACCESS-TOKEN

and then grab the (data[x].location.latitude, data[x].location.longitude) from the API response. Each response will give you about 20 photos, use MAX_ID param in API to get next set of 20 photo data.

Here is an implementation of exactly what you are looking for: gramfeed

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top