Meta Marketing API
APIManage Meta ad campaigns and read ad account performance
- Price
- Ad spend varies
- Access
- User access token with ads permission
About
Meta Marketing API exposes ad account campaigns, ad sets, ads and reporting for Facebook and Instagram advertising. The Meta Business SDK can read and create campaigns with a user access token that has the ads_management permission.
What you can do with it
- Create and update campaigns in a Meta ad account
- List campaigns and inspect their status from an ad account
- Retrieve advertising insights for campaign reporting
Get started
- Register a Meta app and add the Marketing API product
- Request a user token with ads_management permission
- Use the ad account ID to list or create campaigns
Example
from facebook_business.api import FacebookAdsApi
from facebook_business.adobjects.adaccount import AdAccount
FacebookAdsApi.init(access_token="YOUR_ACCESS_TOKEN")
campaigns = AdAccount("act_YOUR_AD_ACCOUNT_ID").get_campaigns(
fields=["id", "name", "status"]
)
for campaign in campaigns:
print(campaign)Details
- Hosting
- Hosted service
- Available in
- Worldwide
- Official SDKs
- Python
- MCP server
- None
- Works with
- Meta Ads