I want to get all images within a location from the Instagram API
.
Here is my code in python
:
from instagram.client import InstagramAPI
client_id = ********
client_secret = *******
access_token = *******
client_ip = *******
q = None
count = 100
lat = 51.51608899635712
lng = 0.09891956707558282
min_timestamp, max_timestamp = None, None
distance = 1000
api = InstagramAPI(client_id=client_id, client_secret=client_secret, client_ips=client_ip, access_token=access_token)
media_all_ids = []
media_ids, next = api.media_search(q, count, lat, lng, min_timestamp, max_timestamp, distance)
for media_id in media_ids:
media_all_ids.append(media_id.id)
The main problem is it gives me this error:
media_ids,next = api.media_search(q, count, lat, lng, min_timestamp, max_timestamp, distance)
ValueError: too many values to unpack
I want to print out their IDs alongside their image link and the time the photo was captured.
I was wondering if someone knows how to solve this issue?