Facebook API

Facebook Company ads API

List the Meta Ad Library ads a company is running by page ID or company name (creative text, format, platforms, and run dates) with cursor pagination.

$1.10/1k req, pay per request, no subscription.

What the API returnedads[0]
{
"id": "1185617869915074",
"pageId": "281940573310482",
"pageName": "Trailhead Outdoors",
"active": true,
"startDate": 1755302400,
"endDate": 1758758400,
"currency": "USD",
"text": "Built from 20D ripstop nylon, the Wren 2 tent weighs 2.1 lbs and sets up in under 90 seconds. Backed by our lifetime warranty.",
... 18 more fields
}
Uptime
99.79%
30d · 166,076 calls
Requests
166,128
30d · weekly, last 12 wks
Response
1.1s
median · 30d

Pricing and providers

Facebook Company ads API pricing: one API, 2 interchangeable providers

The cheapest provider serves first. If it fails, the next one takes over in the same call.

You pay
$11.00
$1.10/1k req, only for what you use. No monthly plan.
Your first 90 requests are free with the $0.10 starting balance.

Try it

Get Facebook company ads in one request

Open in
Get a free key
Sample response
Free runs return only the first 3 results. Fund a key to get the full response.

This sample shows 34 of 46 fields. See every field

{
  "found": true,
  "data": {
    "nextCursor": "AbTr8k2m9x1v7c3q",
    "totalResults": 18,
    "ads": [
      {
        "id": "1185617869915074",
        "pageId": "281940573310482",
        "pageName": "Trailhead Outdoors",
        "active": true,
        "startDate": 1755302400,
        "endDate": 1758758400,
        "currency": "USD",
        "text": "Built from 20D ripstop nylon, the Wren 2 tent weighs 2.1 lbs and sets up in under 90 seconds. Backed by our lifetime warranty.",
        "displayFormat": "DCO",
        "platforms": [
          "facebook",
          "instagram"
        ],
        "adCount": 2,
        "pageProfilePicture": "https://scontent.fbcdn.net/trailhead-profile.jpg",
        "media": [
          {
            "type": "photo",
            "url": "https://scontent.xx.fbcdn.net/v/t45.1600-4/wren-tent-creative-1.jpg",
            "width": 1080,
            "height": 1080
          }
        ],
        "caption": "trailheadoutdoors.com",
        "linkDescription": "Free returns within 60 days.",
        "pageUrl": "https://www.facebook.com/trailheadoutdoors",
        "pageCategories": [
          "Product/service",
          "Outdoor recreation"
        ],
        "pageLikes": 22400,
        "isReshared": false,
        "pageDeleted": false,
        "categories": [
          "Uncategorized"
        ],
        "title": "The 3 season tent that packs to a water bottle",
        "ctaText": "Shop Now",
        "ctaType": "SHOP_NOW",
        "linkUrl": "https://trailheadoutdoors.com/products/wren-2-tent"
      },
      {
        "id": "1092837465210983",
        "pageId": "281940573310482",
        "pageName": "Trailhead Outdoors",
        "active": true,
        "startDate": 1753488000,
        "endDate": 1759104000,
        "currency": "USD",
        "text": "Our down quilt drops to 15F and packs down to the size of a grapefruit. Made for thru hikers who count every ounce.",
        "displayFormat": "IMAGE",
        "platforms": [
          "facebook",
          "instagram",
          "messenger"
        ],
        "adCount": 1,
        "pageProfilePicture": "https://scontent.fbcdn.net/trailhead-profile.jpg",
        "media": [
          {
            "type": "photo",
            "url": "https://scontent.xx.fbcdn.net/v/t45.1600-4/trailhead-quilt-creative.jpg",
            "width": 1080,
            "height": 1350
          }
        ],
        "caption": "trailheadoutdoors.com",
        "linkDescription": "Ships in 2 to 3 business days.",
        "pageUrl": "https://www.facebook.com/trailheadoutdoors",
        "pageCategories": [
          "Product/service",
          "Outdoor recreation"
        ],
        "pageLikes": 22400,
        "isReshared": false,
        "pageDeleted": false,
        "categories": [
          "Uncategorized"
        ],
        "title": "15F down quilt, packs to a grapefruit",
        "ctaText": "Shop Now",
        "ctaType": "SHOP_NOW",
        "linkUrl": "https://trailheadoutdoors.com/products/down-quilt-15f"
      }
    ]
  }
}

Full parameter and response reference - every field, type, and example for this endpoint.

Reference

One request, one response shape.

Every field you send and every field you get back, each with a real example.

Last verified 2026-10-31 · uptime and latency measured over 30d

Request body

JSON, posted to this endpoint.

  • companyNamestring

    Trailhead Outdoors

    Company name to search (e.g. "nike"). Exact-match and case-sensitive against the Meta Ad Library index; an advertiser with no indexed page returns found:false.

  • countrystring

    Two-letter country code to scope results. Defaults to all countries.

  • cursorstring

    Opaque pagination cursor from a previous response's nextCursor.

  • endDatestring

    Filter to ads with impressions on or before this date, in YYYY-MM-DD format.

  • languagestring

    Two-letter language code to filter ads (e.g. "EN", "ES", "FR").

  • mediaTypeenum

    Creative media type filter.

  • pageIdstring

    Company's Ad Library page ID. Provide either pageId or companyName.

  • sortByenum

    recent

    Sort order: impressions (highest first, the default) or recent (most recent).

  • startDatestring

    Filter to ads with impressions on or after this date, in YYYY-MM-DD format.

  • statusenum

    Ad status filter. Defaults to ACTIVE.

You send. A small JSON body. The values shown are examples to replace with your own.

Response

JSON, one example value per field.

each addata.ads[]
  • activeboolean

    true

  • adCountinteger

    2

    Number of ads in this campaign (collation count). Null when the source does not report it.

  • captionstring

    trailheadoutdoors.com

    Caption line of the ad creative, usually the advertiser's display domain.

  • categoriesstring[]

    Ad Library categories the ad is filed under.

  • ctaTextstring

    Shop Now

    Call-to-action button label on the ad.

  • ctaTypestring

    SHOP_NOW

    Call-to-action button type on the ad, e.g. "SHOP_NOW".

  • currencystring

    USD

  • displayFormatstring

    DCO

    Populated whenever the provider has data for the entity.

  • endDateinteger

    1758758400

    Epoch seconds.

  • idstring

    1185617869915074

    Ad Library archive ID. Populated whenever the provider has data for the entity.

  • isResharedboolean

    false

    Whether the ad creative is a reshare of another post.

  • linkDescriptionstring

    Free returns within 60 days.

    Description text shown under the ad's link.

  • linkUrlstring

    https://trailheadoutdoors.com/products/wren-2-tent

    Destination URL the ad links to.

  • pageCategoriesstring[]

    Categories Facebook lists the advertising page under.

  • pageDeletedboolean

    false

    Whether the advertising page has been deleted.

  • pageIdstring

    281940573310482

    Populated whenever the provider has data for the entity.

  • pageLikesinteger

    22400

    Like count of the advertising page.

  • pageNamestring

    Trailhead Outdoors

    Populated whenever the provider has data for the entity.

  • pageProfilePicturestring

    https://scontent.fbcdn.net/trailhead-profile.jpg

    Profile picture of the advertising page. This is the advertiser's identity image, not ad creative.

  • pageUrlstring

    https://www.facebook.com/trailheadoutdoors

    Canonical Facebook URL of the advertising page.

  • platformsstring[]

    Populated whenever the provider has data for the entity.

  • startDateinteger

    1755302400

    Epoch seconds. Populated whenever the provider has data for the entity.

  • textstring

    Built from 20D ripstop nylon, the Wren 2 tent weighs 2.1 lbs and sets up in under 90 seconds. Backed by our lifetime warranty.

    Ad body text. Populated whenever the provider has data for the entity.

  • titlestring

    The 3 season tent that packs to a water bottle

    Headline of the ad creative.

each creativedata.ads[].creatives[]

One entry per card of a carousel, dynamic-product, or dynamic-creative ad, in the order Meta returns them, each with its own text and destination. Single-creative ads return an empty array. The same card images and videos also appear in media. Meta CDN media URLs are signed and expire.

  • bodystring

    Card body text.

  • captionstring

    Card display caption, usually the destination domain.

  • ctaTextstring

    Card call-to-action label (e.g. "Shop Now").

  • ctaTypestring

    Card call-to-action type (e.g. "SHOP_NOW").

  • imagestring

    Card image URL. For a video card this is the poster frame.

  • linkDescriptionstring

    Card secondary description line.

  • linkUrlstring

    Card destination URL.

  • titlestring

    Card headline.

  • videoUrlstring

    Card video file URL (HD when supplied, otherwise SD). Present only on video cards.

each mediadata.ads[].media[]

Creative attached to the ad: one element per image, video, or carousel card, in the order the ad presents them. Empty when the ad has none.

  • heightinteger

    1080

    Pixel height of the media item, when the lane reports it.

  • typestring

    photo

    One of photo, video, or gif.

  • urlstring

    https://scontent.xx.fbcdn.net/v/t45.1600-4/wren-tent-creative-1.jpg

    Image URL. For a video or GIF this is the poster/thumbnail frame.

  • videoUrlstring

    Playable video file URL. Present only for video and gif items.

  • widthinteger

    1080

    Pixel width of the media item, when the lane reports it.

datadata
  • nextCursorstring

    AbTr8k2m9x1v7c3q

    Opaque cursor for the next page of ads, or null when this lane has no more. Pass it back as cursor to continue.

  • totalResultsinteger

    18

    Total number of ads Facebook reports for the page.

top level
  • foundboolean

    true

  • reason"not_found"

    Present only when `found` is false, and says why there is no result. `not_found`: the source states the target does not exist, or returned nothing for it. A `found: false` answer is a successful call, not an error, and `costUsd` is what it actually cost.

You get back. Named, typed fields in the same shape whichever source answers.

Selling this API? See the full schema your endpoint must return.

FAQ

About the Facebook Company ads API

The AnyAPI Facebook Company ads API returns Facebook company ads data as normalized JSON from one POST call to /v1/run/facebook.company_ads. List the Meta Ad Library ads a company is running by page ID or company name (creative text, format, platforms, and run dates) with cursor pagination. AnyAPI routes each request across 2 sources and falls back automatically when one fails. It costs from $1.10 per 1,000 requests, in US dollars with no subscription and no monthly minimum. Over the last 30 days, 99.8% of Facebook company ads calls through AnyAPI succeeded, with a median response time of 1.1 seconds across 166,076 measured calls.

It costs from $1.10 per 1,000 requests, in US dollars with no subscription and no monthly minimum. You fund one USD wallet and each call draws it down. Some failed wallet-funded requests incur processing charges that we pass through at cost, with no markup; the error response shows the amount charged.

List the Meta Ad Library ads a company is running by page ID or company name (creative text, format, platforms, and run dates) with cursor pagination. The response is normalized JSON with the same envelope every AnyAPI endpoint returns, so parsing a second endpoint is a change of URL and nothing else.

Over the last 30 days, 99.8% of Facebook company ads calls through AnyAPI succeeded, with a median response time of 1.1 seconds across 166,076 measured calls. These are AnyAPI's own measurements of traffic through the gateway, recomputed continuously, not a published service-level target.

Yes. A new AnyAPI account starts with $0.10 of free balance and no card required, which covers 90 Facebook Company ads calls at $0.0011 each.

AnyAPI asks the next of its 2 sources in the same request, cheapest first, so one source going down does not fail your call.

Send a POST request to https://api.getanyapi.com/v1/run/facebook.company_ads with your AnyAPI key in an "Authorization: Bearer" header and the input as a JSON body. The same key and the same wallet work on every AnyAPI endpoint.

No. You add US dollars to one prepaid AnyAPI balance and each request draws it down. There is no monthly plan and no minimum, and the same balance pays for every AnyAPI endpoint.

Yes. Install @getanyapi/sdk from npm for TypeScript or getanyapi from pip for Python. Both call every AnyAPI endpoint with the same key, and any HTTP client works too.

Yes. An agent can connect to the AnyAPI MCP server at https://api.getanyapi.com/mcp, or create its own free-trial key with one unauthenticated POST to https://api.getanyapi.com/agent/signup and call this endpoint over HTTP.