Getting Started with Instagram API
Introduction
Description of Instagram RESTful API.
Current limitations:
- Instagram service does not support cross origin headers for security reasons, therefore it is not possible to use Swagger UI and make API calls directly from browser.
- Modification API requests (
POST,DELETE) require additional security scopes that are available for Apps created on or after Nov 17, 2015 and started in Sandbox Mode. - Consider the Instagram limitations for API calls that depends on App Mode.
Warning: For Apps created on or after Nov 17, 2015 API responses
containing media objects no longer return the data field in comments and likes nodes.
Last update: 2015-11-28
Instagram Developer Documentation: https://instagram.com/developer
Install the Package
The package is compatible with Python versions 3.7+.
Install the package from PyPi using the following pip command:
pip install sdk-instagram==1.0.0
You can also view the package at: https://pypi.python.org/pypi/sdk-instagram/1.0.0
Initialize the API Client
Note: Documentation for the client can be found here.
The following parameters are configurable for the API Client:
| Parameter | Type | Description |
|---|---|---|
| environment | Environment |
The API environment. Default: Environment.PRODUCTION |
| http_client_instance | HttpClient |
The Http Client passed from the sdk user for making requests |
| override_http_client_configuration | bool |
The value which determines to override properties of the passed Http Client from the sdk user |
| http_call_back | HttpCallBack |
The callback value that is invoked before and after an HTTP call is made to an endpoint |
| timeout | float |
The value to use for connection timeout. Default: 60 |
| max_retries | int |
The number of times to retry an endpoint call if it fails. Default: 0 |
| backoff_factor | float |
A backoff factor to apply between attempts after the second try. Default: 2 |
| retry_statuses | Array of int |
The http statuses on which retry is to be done. Default: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524] |
| retry_methods | Array of string |
The http methods on which retry is to be done. Default: ['GET', 'PUT'] |
| api_key_credentials | ApiKeyCredentials |
The credential object for Custom Query Parameter |
| instagram_auth_credentials | InstagramAuthCredentials |
The credential object for OAuth 2 Implicit Grant |
The API client can be initialized as follows:
from instagramapi.configuration import Environment
from instagramapi.http.auth.api_key import ApiKeyCredentials
from instagramapi.http.auth.instagram_auth import InstagramAuthCredentials
from instagramapi.instagramapi_client import InstagramapiClient
from instagramapi.models.o_auth_scope_instagram_auth_enum import OAuthScopeInstagramAuthEnum
client = InstagramapiClient(
api_key_credentials=ApiKeyCredentials(
access_token='access_token'
),
instagram_auth_credentials=InstagramAuthCredentials(
o_auth_client_id='OAuthClientId',
o_auth_redirect_uri='OAuthRedirectUri',
o_auth_scopes=[
OAuthScopeInstagramAuthEnum.BASIC,
OAuthScopeInstagramAuthEnum.COMMENTS
]
),
environment=Environment.PRODUCTION
)
Authorization
This API uses the following authentication schemes.
List of APIs
SDK Infrastructure
HTTP
Utilities
Metadata
Release files for sdk-instagram 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sdk_instagram-1.0.0.tar.gz | 30.9 kB | Without provenance | Details for sdk_instagram-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sdk_instagram-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for sdk_instagram-1.0.0-py3-none-any.whl |
Total release size: 108.1 kB
Release files / sdk_instagram-1.0.0.tar.gz
| Download URL | sdk_instagram-1.0.0.tar.gz |
|---|---|
| Size | 30.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d7fbba766d68a6e274b25313c50d65b6697c7b73eb670b747ac5d1c0cefe45f4
|
|
BLAKE2b-256 checksum How to use checksums |
8db2769029b1bd224fcf8e66b6cf060dc4d7d61fb8894817dee75fbf0e46e0d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.13
|
Release files / sdk_instagram-1.0.0-py3-none-any.whl
| Download URL | sdk_instagram-1.0.0-py3-none-any.whl |
|---|---|
| Size | 77.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d08e7478cc29ab780431da9c7233b463a45d101e56ef51f7ab730cdcd8c9aea9
|
|
BLAKE2b-256 checksum How to use checksums |
a9a2909769cc1d052f8e8dfeb5e57feeb05516703cd57293e303b038a505a50c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.13
|
Security for sdk-instagram 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.