Skip to main content

API wrapper for Instagram written in Python

Project description

# instagram-python

instagram-python is an API wrapper for Instagram written in Python

## Installing
```
pip install instagram-python-lib
```

## Usage
```
from instagram.client import Client

client = Client('CLIENT_ID', 'CLIENT_SECRET')
```

Get authorization url
```
scopes = ['basic']
url = client.authorization_url('REDIRECT_URI', scopes)
```

Exchange the code for a token
```
token = client.exchange_code('REDIRECT_URI', 'CODE')
```

Set the token
```
client.set_access_token('TOKEN')
```

Get account information
```
response = client.get_account(')
```

Get media
```
response = client.get_media('MEDIA_ID')
```

### Webhooks
Create subscription
```
response = client.create_subscription('user', 'media', 'A_SECRET_RANDOM_KEY', 'NOTIFICATION_URL')
```

Get subscriptions
```
response = client.get_subscriptions()
```

Delete subscription
```
response = client.delete_subscription('SUBSCRIPTION_ID')
```

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

instagram-python-lib-0.1.2.tar.gz (2.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page