API wrapper for Facebook written in Python
Project description
# facebookmarketing-python
facebookmarketing is an API wrapper for Facebook written in Python
## Installing
```
pip install facebookmarketing-python
```
## Usage
```
from facebookmarketing.client import Client
client = Client('APP_ID', 'APP_SECRET', 'v2.10')
```
Get authorization url
```
url = client.authorization_url('REDIRECT_URL', ['manage_pages'])
```
Exchange the code for an access token
```
token = client.exchange_code('REDIRECT_URL', 'CODE')
```
Extend a short-lived access token for a long-lived access token
```
token = client.extend_token('SHORT-LIVED TOKEN')
```
Get app token
```
token = client.get_app_token()
```
Inspect a token
```
info = client.inspect_token('INPUT TOKEN', 'APP TOKEN')
```
Set the access token
```
client.set_access_token('TOKEN')
```
Get account information
```
account = client.get_account()
```
Get account pages
```
pages = client.get_pages()
```
Get forms given the page
```
forms = client.get_ad_account_leadgen_forms('PAGE_ID')
```
Get leads given the form
```
leads = client.get_ad_leads('FORM_ID')
```
## Requirements
- requests
## Tests
```
python tests/test_client.py
```
## TODO Endpoints
- Ad Creative
- Image Ad
- Previews
- Ad Preview Plugin
- Ad Set
- Ad User
- Ad Video
- Campaign
- Connection Objects
- Currencies
- Image Crop
- Product Catalog
facebookmarketing is an API wrapper for Facebook written in Python
## Installing
```
pip install facebookmarketing-python
```
## Usage
```
from facebookmarketing.client import Client
client = Client('APP_ID', 'APP_SECRET', 'v2.10')
```
Get authorization url
```
url = client.authorization_url('REDIRECT_URL', ['manage_pages'])
```
Exchange the code for an access token
```
token = client.exchange_code('REDIRECT_URL', 'CODE')
```
Extend a short-lived access token for a long-lived access token
```
token = client.extend_token('SHORT-LIVED TOKEN')
```
Get app token
```
token = client.get_app_token()
```
Inspect a token
```
info = client.inspect_token('INPUT TOKEN', 'APP TOKEN')
```
Set the access token
```
client.set_access_token('TOKEN')
```
Get account information
```
account = client.get_account()
```
Get account pages
```
pages = client.get_pages()
```
Get forms given the page
```
forms = client.get_ad_account_leadgen_forms('PAGE_ID')
```
Get leads given the form
```
leads = client.get_ad_leads('FORM_ID')
```
## Requirements
- requests
## Tests
```
python tests/test_client.py
```
## TODO Endpoints
- Ad Creative
- Image Ad
- Previews
- Ad Preview Plugin
- Ad Set
- Ad User
- Ad Video
- Campaign
- Connection Objects
- Currencies
- Image Crop
- Product Catalog
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for facebookmarketing-python-0.1.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f270393775d69fbcc2e3fc4dbb0f6bc0346cc51026dd3c50a0ff408fd1013a93 |
|
MD5 | c2eb356adc7b34212d6d173f6dd5e695 |
|
BLAKE2b-256 | a852d53acb6f6883e1ad837f8b4ef2cbdd91d8fc9666658b9a84a2a32b5e4f36 |