Marketing API Introduction
Understanding Access Tokens
There are 3 types of access tokens, short-lived access tokens which last for 2 hours, long-lived access tokens which last about 60 days except for apps with Standard access which last indefinitely, and System User access tokens which last indefinitely so developers can use for more than one script or system.
Creating an App with Marketing API
The Ads App flow takes you through all the steps you need to create an ads app. An app is actually a container for any type of Facebook ads functionality you build with Marketing API. Your app can be a proof of concept, scripts to automate marketing, or an app for advertisers to use to run ads. The Ads app simplifies and larger process. Read on if you want the background:
- Create Ad Account - Use it to manage access to your ads, billing settings, and spending limits. Provide billing information, but you will not be charged until you run an ad.
- Developer Account - Access to our developer tools and enables you to create Facebook apps.
- Get Access Token - You can get a System User access token or a User access token with long-lived expiration with the permissions
- Create App - Create a Facebook app and get an app ID. You use the ID to make API calls.
- Provide App Settings - Configure your Facebook App for using the Marketing API and other settings.
- Facebook Marketing Developer Community - Ask your technical questions about Marketing APIs from other developers.
- Facebook Marketing Developers Page - For quick updates on API enhancements and new features.
- Audience Management
- Ads Management
- Ads Insights
- Business Manager API
- Marketing API SDKs
- Marketing API Reference Samples
- Marketing API Accelerator
- API Reference Docs
- Facebook for Business
Who should use the Marketing API ?
You may benefit from using the Marketing API if you match one of these profiles:
As an advertising management solutions provider, you sell to advertisers or agencies who manage ads on digital properties, including Facebook. You can review our list of current partners, see Facebook Marketing Partners.
As an advertiser, you manage your own ad spend, have significant advertising scale specifically on the Facebook platform and require a custom solution that leverages your own internal data.
Before you get started, please review Components of a Successful Integration, which is a checklist to determine the value of building an app on the API and to help you understand the investment needed to be successful.
For most advertisers, building an in-house ads management tool doesn’t make sense due to resource requirements. We recommend using existing Facebook and/or partner tools that fit your needs instead
Does Facebook charge for Marketing API calls?
No. Facebook doesn't currently charge for Marketing API calls.
How can I test the Marketing API?
You can perform your testing in Sandbox Mode. This mode provides a testing environment that helps you create an ad account that is enabled for making Marketing API calls, however it doesn't actually deliver ads. For more information, see Sandbox Mode for Developers.
How do I get access to the Marketing API ?
The API has three levels of access: development, basic and standard. You can get started with the development access level by creating a new app (or use an existing app, if you already have one) and obtaining an access token to start making API calls.
Once you have a successful integration with the Marketing API at the development access level, you can apply for basic access through your app's Status and Review page. Learn more about Marketing API access levels.
Where can I find sample code that uses the Marketing API?
For sample code, please review the API documentation on this site. We also have code samples on Marketing API Accelerator Program.
Who are the tool vendors for the API?
Learn more about tool vendors for the API at Facebook Marketing Partners.