# Turn a Meta Ad Library URL into a spreadsheet

**Use case:** 

Paste the URL from your browser's address bar after you have set the filters you want on the Ad Library website. Every parameter in the URL is applied, keyword, country, status, media type, platforms, languages and dates, and the matching ads come back as rows you can download as JSON, CSV or Excel.

## Input

```json
{
  "searchTerms": [
    "adidas"
  ],
  "searchType": "keyword_unordered",
  "adLibraryUrls": [
    "https://www.facebook.com/ads/library/?active_status=active&ad_type=all&country=US&q=coffee%20subscription&search_type=keyword_unordered"
  ],
  "countries": [
    "US"
  ],
  "adType": "all",
  "activeStatus": "all",
  "mediaType": "all",
  "deliveredWithinDays": "any",
  "sortBy": "default",
  "isTargetedCountry": false,
  "onlyActiveNow": false,
  "maxAds": 20,
  "onlyTotalCount": false,
  "fetchAdDetails": false,
  "resolveLandingPages": false,
  "memoryName": "",
  "emitKnownAds": false,
  "resetMemory": false,
  "maxConcurrency": 3,
  "maxIpRetries": 6,
  "maxEmptyPages": 3,
  "maxKnownPages": 0
}
```

## Output

```json
{
  "adArchiveId": {
    "label": "Library ID",
    "format": "text"
  },
  "pageName": {
    "label": "Advertiser",
    "format": "text"
  },
  "isActive": {
    "label": "Active",
    "format": "boolean"
  },
  "startDate": {
    "label": "Started",
    "format": "date"
  },
  "daysRunning": {
    "label": "Days running",
    "format": "number"
  },
  "displayFormat": {
    "label": "Format",
    "format": "text"
  },
  "publisherPlatforms": {
    "label": "Platforms",
    "format": "array"
  },
  "adText": {
    "label": "Ad text",
    "format": "text"
  },
  "title": {
    "label": "Headline",
    "format": "text"
  },
  "ctaText": {
    "label": "CTA",
    "format": "text"
  },
  "landingDomain": {
    "label": "Landing domain",
    "format": "text"
  },
  "spendText": {
    "label": "Spend",
    "format": "text"
  },
  "impressionsText": {
    "label": "Impressions",
    "format": "text"
  },
  "collationCount": {
    "label": "Creative reuse",
    "format": "number"
  },
  "adLibraryUrl": {
    "label": "Ad Library URL",
    "format": "link"
  }
}
```

## About this Actor

This example demonstrates how to use [Meta Ad Library Scraper - All Placements, Filters](https://apify.com/automation_craft/meta-ads-library-scraper.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/automation_craft/meta-ads-library-scraper.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/automation_craft/meta-ads-library-scraper.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
