For paging response data, see the Graph API Pagination.
You should store user IDs, session keys, and the ads account ID so it is easy to programmatically access them and keep them together. This is important because any calls made with an account ID belonging to one user and the session key for another user will fail with a permissions error.
Run frequent reports on your campaigns, as suggested bids change dynamically in response to bidding by competitors using similar targeting. Bid suggestions get updated within a few hours, depending upon the bidding of competitors.
Make multiple requests to the API with a single call, see:
You can also query for multiple objects by ID as follows:
To query for a specific field:
Quickly check if the response to a request has changed since you last made it, see:
Ad objects have two types of delete states: archived and deleted. You can query both archived and delted objects with the object id. However, we do not return deleted objects if you request it from another object's edge.
You can have up to 5000 archived objects at any time. You should move ad objects from archived states to deleted states if you no longer need to retrieve them via edges. To learn how states work and for sample calls see Storing Ad Objects.
People make mistakes and try to create ads that are not accepted, Error Codes provide reasons an API call failed. You should share some form of the error to users so they can fix their ads.
Marketing API has it is own rate limiting logic and is excluded from all the graph api rate limitations. So if you make a Marketing API call, it won't be calculated into the Graph API throttling. For more information about rate limiting in Graph API, see Rate Limiting on the Graph API.
We enforce rate limits on the number of API calls an ad account has to add or remove users in a data file for custom audiences per 24-hour period. To prevent user data leakage, you cannot remove users in a data file custom audience too frequently. When you reach a rate limit error, we temporarily block you from updating the data file custom audience.
You can determine what your limits are, make a
GET request at
curl -G \ -d "access_token=<ACCESS_TOKEN>" \ "https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/custom_audience_limits"
The response includes:
Whether an ad account reached the daily update limit for a custom audience.
Next time you are allowed to update the custom audience
Number of update calls you can make for ad account before you reach the daily limit for an audience.
Maximum number of daily custom audience update calls the ad account can make.
Sandbox mode is a testing environment to read and write Marketing API calls without delivering actual ads. See Sandbox Mode for Developers
Try API calls with Graph API Explorer. You can try any API call you would like to make to the Marketing API, see blog post. Select your app in
App, and grant your app
ads_read permission in
extended permissions when you create an access token. Use
ads_read if you only need Ads Insights API access for reporting. Use
ads_management to read and update ads in an account.
Demonstrate value beyond Facebook's core solutions, such as Facebook Ads Manager.
Focus on business objectives, such as increase in sales. Facebook business objectives can be found here.
Understand the API policies; Facebook has the right to audit your activity anytime:
Be ready to adapt quickly to changes. Most changes are versioned and change windows are 90 days, ongoing.
In Statement of Rights and Responsibilities, you are financially and operationally responsible for your application, its contents, and your use of Facebook Platform and the Ads API. You should manage your app's stability and potential bugs.