instagram_private_api: Forbidden

Before submitting an issue, make sure you have:

  • Updated to the lastest version v1.5.3
  • Read the README and docs
  • Searched the bugtracker for similar issues including closed ones
  • Reviewed the sample code in tests and examples

Which client are you using?

  • app (instagram_private_api/)
  • web (instagram_web_api/)

Purpose of your issue?

  • Bug report (encountered problems/errors)
  • Feature request (request for a new functionality)
  • Question
  • Other

Issue reproduction: I’m using the un-authorized access:

web_api = Client(auto_patch=False, drop_incompat_keys=False)

user_info = _get_user_info('haydar.aimon')


For a bug report, you must include the Python version used, code that will reproduce the error, and the error log/traceback.

Paste the output of python -V here:

Code:

Traceback (most recent call last):
  File "C:\Users\hayda\Google Drive\Websites\Webapp\New API\instagram_private_api-master\instagram_web_api\client.py", line 234, in _make_request
    res = self.opener.open(req, data=data, timeout=self.timeout)
  File "C:\Program Files\Python36\lib\urllib\request.py", line 532, in open
    response = meth(req, response)
  File "C:\Program Files\Python36\lib\urllib\request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "C:\Program Files\Python36\lib\urllib\request.py", line 570, in error
    return self._call_chain(*args)
  File "C:\Program Files\Python36\lib\urllib\request.py", line 504, in _call_chain
    result = func(*args)
  File "C:\Program Files\Python36\lib\urllib\request.py", line 650, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden

Error/Debug Log:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\hayda\Google Drive\Websites\Webapp\New API\instagram_private_api-master\test.py", line 19, in <module>
    user_info = web_api.user_info2('haydar.aimon')
  File "C:\Users\hayda\Google Drive\Websites\Webapp\New API\instagram_private_api-master\instagram_web_api\client.py", line 314, in user_info2
    info = self._make_request(endpoint, query={'__a': '1'})
  File "C:\Users\hayda\Google Drive\Websites\Webapp\New API\instagram_private_api-master\instagram_web_api\client.py", line 244, in _make_request
    raise ClientError('HTTPError "{0!s}" while opening {1!s}'.format(e.reason, url), e.code)
instagram_web_api.errors.ClientError: HTTPError "Forbidden" while opening https://www.instagram.com/haydar.aimon/?__a=1

Describe your issue

Thank you for this amazing web api, however I’m starting to get: urllib.error.HTTPError: HTTP Error 403: Forbidden on all of my requests. Did Instagram block access to this api? What can I do to resolve this issue?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (4 by maintainers)

Commits related to this issue

Most upvoted comments

This issue happened again. new md5 value is {rhx_gis}:{variables}

Bad news…

I’m still getting the same Forbidden error. What to do?

Are Instagram watching this project or something? There’s been a number of changes in rapid succession over the past several days, and I’ve been using this project as a guideline on how to access the unauthenticated endpoints for my own project.

Thanks to @ping and @2minchul for all the work so far.

And hello Instagram devs! 😁👋

This should be fixed in cc2119b1f53a7799519df18e9a46a49ecd6fd8d0.

@2minchul Thanks for the tip. Fixed in 5133b823e47d62d1642c4a41d1b1b7bfe0c1ae22