Made himself a simple Instagram client to make authenticated requests to their API. However, at startup, it continues to throw the following error:
Traceback (most recent call last): File "request-ig-data.py", line 24, in <module> recent_media = api.user_recent_media(user_id=user_id, count=50) File "/lib/python2.7/site-packages/instagram/bind.py", line 151, in _call return method.execute() File "/lib/python2.7/site-packages/instagram/bind.py", line 143, in execute content, next = self._do_api_request(url, method, body, headers) File "/lib/python2.7/site-packages/instagram/bind.py", line 99, in _do_api_request raise InstagramClientError('Unable to parse response, not valid JSON.') instagram.bind.InstagramClientError: Unable to parse response, not valid JSON.
Ok, so the answer is not JSON (despite the fact that I expect it to be provided with the response format in Instagram doc'd format), but why? The code - a fairly simple python-instagram implementation - followed their docs and tried to convert the response to JSON, but still got the same error. Here is the code:
from instagram.client import InstagramAPI import httplib2 import json import sys client_id = '[...]' client_secret = '[...]' redirect_uri = 'https://mycallback.com' scope = '' user_id = '1034466'
source share