Reputation: 773
I am new to the Instagram API. I used the following code from the example on the github to get the most recent popular media.
from instagram.client import InstagramAPI
id= "OMITTED"
secret = "OMITTED"
api = InstagramAPI(client_id=id, client_secret=secret)
popular_media = api.media_popular(count=20)
for media in popular_media:
print media.images['standard_resolution'].url
I get the following error:
File "example.py", line 6, in <module>
popular_media = api.media_popular(count=20)
File "/usr/lib/python2.6/site-packages/instagram/bind.py", line 197, in _call
return method.execute()
File "/usr/lib/python2.6/site-packages/instagram/bind.py", line 189, in execute
content, next = self._do_api_request(url, method, body, headers)
File "/usr/lib/python2.6/site-packages/instagram/bind.py", line 131, in _do_api_request
raise InstagramClientError('Unable to parse response, not valid JSON.', status_code=response['status'])
instagram.bind.InstagramClientError: (404) Unable to parse response, not valid JSON.
I know it is a valid instagram object because when I print(api). I get the following:
<instagram.client.InstagramAPI object at 0x145c2b10>
This is taken directly from the example and I can't tell what I am doing wrong! Any help would be great!
Upvotes: 1
Views: 848
Reputation: 12952
If u signed up after Nov 17th, Instagram popular photo feed is deprecated in new API.
The library you are using is old, it will only work for popular API if you had signed up for before November 17th
https://www.instagram.com/developer/changelog/
Upvotes: 1