Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
facebookmarketing-python
Advanced tools
facebookmarketing is an API wrapper for Facebook and Instagram written in Python.
pip install facebookmarketing-python
from facebookmarketing.client import Client
client = Client('APP_ID', 'APP_SECRET', 'v4.0')
For more information: https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/
url = client.authorization_url('REDIRECT_URL', 'STATE', ['pages_manage_ads', 'pages_manage_metadata', 'pages_read_engagement', 'leads_retrieval'])
response = client.exchange_code('REDIRECT_URL', 'CODE')
access_token = response['access_token']
response = client.extend_token(access_token) # From previous step
access_token = response['access_token']
response = client.get_app_token()
app_access_token = response['access_token']
response = client.inspect_token(access_token, app_access_token) # From previous step
client.set_access_token(access_token) # From previous step
For more information: https://developers.facebook.com/docs/graph-api/reference/user/
response = client.get_account()
response = client.get_pages()
page_access_token = client.get_page_token('PAGE_ID') # From previous step
For more information: https://developers.facebook.com/docs/graph-api/reference/page/
response = client.get_ad_account_leadgen_forms('PAGE_ID', page_access_token) # From previous step
response = client.get_ad_leads('LEADGEN_FORM_ID')
response = client.get_leadgen('LEADGEN_ID')
For more information: https://developers.facebook.com/docs/graph-api/webhooks
The following methods cover Step 2 and 4 of the Webhook lead retrieval guide: Webhooks: https://developers.facebook.com/docs/marketing-api/guides/lead-ads/retrieving/
response = client.create_app_subscriptions('page', 'callback_url', 'leadgen', 'abc123', app_access_token) # You get app_access_token from get_app_token() method
response = client.create_page_subscribed_apps('PAGE_ID', page_access_token, params={'subscribed_fields': 'leadgen'}) # You get page_access_token from get_page_token() method
from facebookmarketing.client import Client
client = Client('APP_ID', 'APP_SECRET', 'v12.0')
For more information: https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/
url = client.authorization_url('REDIRECT_URL', 'STATE', ['instagram_basic', 'pages_show_list'])
response = client.exchange_code('REDIRECT_URL', 'CODE')
access_token = response['access_token']
response = client.get_instagram(page_id, ['instagram_business_account'])
page_id = response['instagram_business_account']['id']
response = client.get_instagram_media(page_id)
response = client.get_instagram_media_object(media_id, fields=['id','media_type','media_url','owner','timestamp'])
response = (client.get_instagram_hashtag_search(page_id, 'coke'))
response = client.get_instagram_hashtag_object(hashtag_id, fields=['id', 'name'])
response = client.get_instagram_hashtag_top_media(hashtag_id, instagram_id, ['id','media_type','comments_count','like_count', 'caption'])
We are always grateful for any kind of contribution including but not limited to bug reports, code enhancements, bug fixes, and even functionality suggestions.
FAQs
API wrapper for Facebook written in Python
We found that facebookmarketing-python demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.