Exception Hierarchy
All Instagram API exceptions inherit from the baseInstagramError class, which itself inherits from Python’s built-in Exception.
InstagramError
Base exception class for all Instagram API errors.InstagramNetworkError
Raised when network or connection errors occur during API communication.When Raised
- HTTP response status is not 200, 404, or 429
- Network connection failures
- Request timeouts
- Unexpected API responses
- JSON parsing errors
Example
InstagramNotFoundError
Raised when the requested Instagram post cannot be found or accessed.When Raised
- API returns HTTP 404 status
- Post has been deleted
- Post is private and not accessible
- Invalid post URL or ID
- No media items found in the API response
Example
InstagramRateLimitError
Raised when the RapidAPI rate limit has been exceeded.When Raised
- API returns HTTP 429 status
- Too many requests sent in a given timeframe
- RapidAPI subscription limit reached

