Back to Blog

Facebook Ads API Reporting With the Insights API

How to pull Facebook ads reporting data programmatically with Meta's Ads Insights API: what it returns, the access you need, breakdowns, and how to keep reporting jobs from timing out.

What the Ads Insights API reports

Facebook ads API reporting runs through the Ads Insights API. It provides performance data and statistics for Meta ads, and with its flexible reporting options you can customize your requests and obtain nearly any metric available in Meta Ads Manager. That makes it the route for dashboards, scheduled exports and any reporting that has to combine Meta data with other systems.

Insights are available as an edge on ad objects, so you can ask for results at the level you need: the ad account as a whole, or a specific campaign, ad set or ad. Choosing the lowest level that answers your question keeps responses smaller and faster.

Reporting needWhere to query
Account totals for a periodThe ad account's insights
Campaign comparisonInsights at campaign level
Creative or audience detailInsights on the ad set or ad, or with a breakdown

What you need before you call the Insights API

To access the Ads Insights API, you need two things:

  • An app registered with Meta for Developers.
  • The ads_read permission for that app.

Reporting is only as good as the events behind it, so set up your ads to track the actions you care about before you build reports on them. The Conversions API and the Meta Pixel are the tools Meta names for that. Our article on link tracking protection and server-side CAPI explains why server-side tracking matters for reliable conversion data.

Create a system user and token for automated reporting

System users represent servers or software that make API calls to assets owned or managed by a business portfolio. For an automated reporting job, a system user is the right identity: it does not depend on one employee's personal login, so reports keep running when people change roles.

  • Make sure a Facebook app owned by your business is associated with your business portfolio.
  • In Meta Business Suite Settings, open System users under Users and create one.
  • Assign it the ad accounts the report needs, with read access only.
  • Select your app and permissions, including ads_read, and generate a token.
  • Store the token in your server's secret storage, never in code or a shared document.

Agencies reporting across many client portfolios can see how this fits a wider setup in our guide to Meta ads infrastructure for agencies.

Group results with breakdowns

You can group the Insights API results into different sets using breakdowns. A breakdown splits each metric by a dimension such as age, gender, country, device platform or placement, so one request answers questions like which country produced the clicks or which device the impressions came from.

Use breakdowns deliberately. Each one multiplies the number of rows returned, and combining several dimensions on a large account with a long date range is one of the quickest ways to produce a heavy query. Request the breakdown you need for the report in front of you rather than every dimension at once.

Breakdown limits for off-Meta action metrics

Not every metric can be combined with every breakdown. Meta's breakdowns documentation lists fields that should not be requested together with a breakdown, and restricts some breakdowns when they are combined with actions that happen off Meta, such as conversions on your website. On-Meta metrics such as impressions and link clicks keep working with those breakdowns.

In practice, if a breakdown returns an action metric as empty or without its breakdown value, check whether the action happens off Meta before assuming the data is missing. Keep conversion reports and demographic reports as separate queries where the documentation restricts the combination.

Avoid timeouts and rate limits in reporting jobs

The most common issue causing failure for Ads Insights API calls is too many requests and timeouts. There is no explicit limit for when a query will fail; when one times out, break it into smaller queries, for example by using filters like date range.

  • Split long periods into shorter date ranges and combine the results yourself.
  • Ask only for the metrics the report uses.
  • Use asynchronous report jobs for large volumes instead of one synchronous call.
  • Check the x-fb-ads-insights-throttle HTTP header in every response to see how close your app is to its limit and how heavy a query is.
  • Pace jobs through the day and back off when the header shows you are near the limit.

If your API numbers differ from Ads Manager, check attribution first. The default behavior of the API is different from the default behavior of Ads Manager; to observe the same behavior as in Ads Manager, set the useunifiedattribution_setting field to true. Our guide to Meta ads management for e-commerce campaign setup and scaling covers how reporting feeds day-to-day decisions.

Related reading

Frequently Asked Questions

What data can I get from Facebook ads API reporting?

The Ads Insights API provides performance data and statistics for Meta ads, and lets you request nearly any metric available in Meta Ads Manager, at account, campaign, ad set or ad level.

What permission do I need to read ads reporting data through the API?

You need an app and the ads_read permission. For automated jobs, use a system user in your business portfolio with a token generated for that app.

Why do my Insights API reporting requests time out?

Too many requests and timeouts are the most common cause of failed Insights calls. Break heavy queries into smaller ones, for example by date range, and use asynchronous jobs for large volumes.

Why does API reporting not match Ads Manager?

The API's default behavior differs from Ads Manager's. To get the same behavior, set the useunifiedattribution_setting field to true in your request.

Available now: Facebook Accounts & Pages

Live listings from the marketplace page. Stock and prices change; checkout always shows the current price.

See all Facebook Accounts & Pages →