Ads API

From Facebook Developer Wiki

Jump to: navigation, search
Note: This functionality is part of a limited beta program. If you’re interested in participating in the beta test, please contact your Facebook Advertising Account Manager. If you don’t yet have a Facebook Advertising Account Manager, you can request support at http://www.facebook.com/business/contact.php.

The article contains extended documentation about the Facebook Ads API.


Contents

REST Interface

The API uses a REST-like interface. This means that our Facebook method calls are made over the internet by sending HTTP GET or POST requests to the Facebook API REST server . Nearly any computer language can be used to communicate over HTTP with the REST server.

Note: If you manually form your HTTP POST requests to Facebook, you must include the request data in the POST body. In addition, you should include a Content-Type: header of application/x-www-form-urlencoded.

Facebook API

The Facebook Ads API methods are built on top of Facebook Platform. To make Ads API calls, you'll need to create a Facebook Platform application and manage user sessions. Developers new to the Ads API should read the Getting Started guide.

API Structures

ads.campaign_specs
Definition of the campaign_specs array
ads.adgroup_specs
Definition of the adgroup_specs array
ads.targeting_specs
Definition of the targeting array
ads.creative_specs
Definition of the creative array


API Methods

ads.getAccounts
Returns the user's Ads Account ID.
ads.getConnectionObjectIds
Returns a list of valid Connection IDs.
ads.getCampaigns
Returns all of the user's Facebook Ads Campaigns.
ads.createCampaigns
Creates new Facebook Ads Campaigns.
ads.updateCampaigns
Updates existing Facebook Ads Campaigns.
ads.getCampaignStats
Returns basic campaign statistics.
ads.getAutoCompleteData
Returns a list of possible Facebook Ads targeting data.
ads.getAdGroups
Returns all of the user's Facebook AdGroups.
ads.createAdGroups
Creates new Facebook AdGroups.
ads.updateAdGroups
Updates existing Facebook AdGroups.
ads.getAdGroupStats
Returns basic AdGroup statistics.
ads.getAdGroupTargeting
Returns targeting specifications for existing AdGroups.
ads.getAdGroupCreatives
Returns ad creative information for existing AdGroups.
ads.estimateTargetingStats
Returns an estimate of the users the proposed AdGroup may reach.

Additional APIs and Other Documentation