Facebook Ads API
Making marketing easier and more effective

Overview

Facebook's Ads API allows you to create and access your ads programmatically. You can use the API to build tools that add value to customers on top of Facebook's Ads Manager and Power Editor. Learn more about the API here.

Ad Objects

A Facebook User can create an Ad Account to start running ads. Within your ad account you can organize your ads by ad campaign. Each campaign contains individual ad groups, which contain the bid, targeting, and ad creative. The ad creative defines the visual attributes of the ad. Learn more about each type of object below:

Ad User

An Ad User is a regular Facebook user who chooses to create Ads.

Ad Account

An ad account is an account object for managing ads.

Ad Account Group

A group for managing access to Facebook ad accounts.

Ad Campaign

A campaign for managing ad groups.

Ad Group

An ad group contains the data necessary for an ad, such as bid info, max bid, targeting data, creative elements, and campaign information.

Ad Creative

An ad creative object contains the information to render the look of the ad.

Ad Image

Images for use in ads

New Campaign Structure

Starting on our target date of March 4, 2014, the new campaign structure will offer a new way to organize marketing initiatives, segment audiences, optimize placements and track performance across multiple campaigns. This change will make it easier for advertisers to organize, optimize and measure ads by introducing a three-level campaign structure: campaigns, ad sets and ads. To learn more about the changes to each object and the migration plan, refer to the PMD News breaking changeannouncement if you are a member of the group and the documents below:

New Campaign Structure Migration Plan

This document describes the changes involved in the new campaign structure migration

FAQ

This document addresses the frequently asked questions regarding the new campaign structure migration

Ad Campaign

A campaign for managing ad sets.

Ad Set

A set for managing ads.

Ad Group

An ad group contains the data necessary for an ad, such as bid info, max bid, targeting data, creative elements, and campaign information.

Ad Types

Use Facebook ads and sponsored stories to communicate with your existing customers and to reach new ones. Each guide below outlines Facebook's ads products to help you achieve your advertising goals.

Page Post Ads

Page Post ads help you reach new and existing customers with a message from your brand.

Page ads

A Page like ad is best used for fan acquisition.

Mobile App Ads for Install

Mobile app ads for installs are an effective way to grow your mobile app.

Mobile App Ads for Engagement

Mobile app ads for engagement help you drive engagement and conversion. You can keep existing users active within your app, even after they install.

Desktop App Ads

Desktop App Ads allow you to effectively drive and measure installs for your Facebook desktop apps (canvas apps). These ads will appear in both News Feed and the right hand column of Facebook's website.

Sponsored Stories

Sponsored stories allow you to take advantage of word-of-mouth advertising at scale. When people interact with your brand, you can pay to promote that activity to their friends. They help people discover your Page, app or event through their friends.Reference

Domain Ads

A domain ad is best to drive visits to a website and for online sales.

FBX

Facebook Exchange (FBX) is a real-time bidding interface for buying Facebook ad inventory.

Event Ads

An event ad is best used to get people to join and attend your event.

Homepage ads

Homepage ads allow you to buy on a fixed CPM.

Bidding

There are different ways to buy ads on Facebook. Learn more about each below:

CPM

Allows you to bid on impressions

CPC

Allows you to bid on clicks

optimized CPM

Allows you to bid on actions that are important to you

CPA

Allows you to bid and pay on actions that are important to you

Targeting

Facebook's targeting allows you to reach the right audience. Learn more about Facebook's targeting options below:

Targeting Spec

This guide talks you through how to define the targeting of your ad.

Action Spec

This guide and reference take you through what Action Spec is and how it can be used in targeting.
Guide | Reference

Broad Category Targeting

This guide takes you through how to use broad category targeting

Topic Targeting

This guide takes you through how to use topic targeting

Custom Audiences

This guide takes you through how to use your own data to target on Facebook.

Lookalike Audiences

This guide takes you through how to create a lookalike audience based off of your existing Custom Audience.

Partner Categories

This guide takes you through how to use third party approved data to target on Facebook.

Measurement

It's important to monitor your ad's performance. Doing this will give you information about what's working for your audience so you can see how they’re performing against your goals and calculate their return on investment. Learn more about how to measure and optimize your ads below:

View tags

This guide takes you through how to track impressions on Facebook.

Click tags

This guide takes you through how to track clicks to offsite links from Facebook ads

Conversion Pixel

This guide takes you through how to use a conversion pixel to track and optimize for actions on your website.

Tracking Specs

This guide takes you through how to use tracking specs to define actions you want to track.

Conversion Specs

This guide takes you through how to use conversion specs to optimize your ad towards a desired action.

Action Spec

This guide and reference take you through what Action Spec is and how it can be used in measurement.
Guide | Reference

Ad Statistics

This guide takes you through how to get statistics on your ad performance.

Ad Report Stats

This guide takes you through the new ad report stats api.

Conversion Statistics

This guide takes you through how to get statistics conversions you are tracking.

Best Practices

Once you have learned the basics, we encourage you to optimize your API calls using the techniques below:

Batch Requests

Learn how to batch your API calls for greater efficiency

eTags

Learn how to optimize your calls to only fetch data when it has changed

Rate Limiting

This guide takes you through the different rate limits on the API and how to deal with them

Error codes

A reference of the error codes the API returns, and their meanings
Was this document helpful?