PrivateAccount

The target account is private and this login cannot view it.

The error#

PrivateAccount is raised when the message contains:

Not authorized to view user

The class docstring is This Account is Private. The exception message is the Instagram message, not the docstring, because the message is non-empty.

Nearby strings on the same 400 branch, and their classes:

Invalid target user
Invalid media_id
Media is unavailable

Those raise InvalidTargetUser, InvalidMediaId and MediaUnavailable.

What triggers it#

A private API 400 whose message contains Not authorized to view user. The GraphQL mixin raises PrivateAccount for the same condition.

How to confirm#

The class is PrivateAccount. The text contains Not authorized to view user. LoginRequired means your session died. This class means the session is valid and the other account is closed.

Fixes#

Follow the account with the user you are logged in as, or ask them to accept you. instagrapi does not override a private account. Retrying user_info does not change is_private. Media calls for that user keep failing until the follow exists.

SocialScrape#

Instagram profile is GET /v1/instagram/profile. A private account comes back with is_private true. Posts are GET /v1/instagram/profile/posts, and one post is GET /v1/instagram/post.

Failed requests cost 0 credits. New accounts get 100 credits on signup, no card. Codes are on errors.

Questions

What does the SocialScrape profile endpoint do?

It returns the public profile and sets is_private true. It does not return the private feed.

Is Media is unavailable the same class?

No. That substring raises MediaUnavailable.