> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ScrapeCreators: Facebook Adlibrary Company Ads

> Facebook: Fetches all ads currently running for a specific company from the Meta Ad Library. Includes inputs, outputs, SDK V2 examples, and Deepline cost.

Facebook: Fetches all ads currently running for a specific company from the Meta Ad Library.

> [!NOTE]
>
> Tool ID: `scrapecreators_facebook_adlibrary_company_ads`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'scrapecreators_facebook_adlibrary_company_ads',
  {
    "pageId": "page_123",
    "companyName": "Example Corp",
    "country": "US"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute scrapecreators_facebook_adlibrary_company_ads --input '{
  "pageId": "page_123",
  "companyName": "Example Corp",
  "country": "US"
}' --json
```

## Example response

The static output schema lacks the details for a reliable example. Use `deepline describe scrapecreators_facebook_adlibrary_company_ads --json` for the complete live contract.

## Input reference

Fetches all ads currently running for a specific company from the Meta Ad Library. Each ad includes ad\_archive\_id, page\_name, is\_active, publisher\_platform, and a snapshot with body, images, videos, and display\_format. Supports filtering by country, media\_type, date range, and language with cursor-based pagination. Both GET and POST are supported. If the cursor becomes too large after extensive pagination, use POST and send the same parameters in the JSON body.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.pageId` | `string` | No | — | The companies ad library page id. You can get this with my Search For Companies Endpoint. Can either use this or companyName |
| `payload.companyName` | `string` | No | — | The name of the company. Can either use this or pageId |
| `payload.country` | `string` | No | — | This can only be one country. It has to be the 2 letter code for the country. It defaults to ALL. |
| `payload.status` | `"ALL" \| "ACTIVE" \| "INACTIVE"` | No | — | Status of the ad. Defaults to ACTIVE. Allowed: `ALL`, `ACTIVE`, `INACTIVE`. |
| `payload.media_type` | `"ALL" \| "IMAGE" \| "VIDEO" \| "MEME" \| "IMAGE_AND_MEME" \| "NONE"` | No | — | Media type of the ad. Defaults to ALL. Meme refers to ads with image and text. Not sure why they call it meme. Allowed: `ALL`, `IMAGE`, `VIDEO`, `MEME`, `IMAGE_AND_MEME`, `NONE`. |
| `payload.language` | `string` | No | — | Language to filter ads on. Needs to be 2 letter language code, ie EN, ES, FR, etc |
| `payload.sort_by` | `"total_impressions" \| "relevancy_monthly_grouped"` | No | — | Sort by impressions (high to low), or Most Recent (relevancy\_monthly\_grouped). Defaults to impressions. Allowed: `total_impressions`, `relevancy_monthly_grouped`. |
| `payload.start_date` | `string` | No | — | Start date to search for. Format: YYYY-MM-DD |
| `payload.end_date` | `string` | No | — | End date to search for. Format: YYYY-MM-DD |
| `payload.trim` | `boolean` | No | — | Set to true for a trimmed down version of the response |
| `payload.cursor` | `string` | No | — | Cursor to paginate through results |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Fetches all ads currently running for a specific company from the Meta Ad Library. Each ad includes ad_archive_id, page_name, is_active, publisher_platform, and a snapshot with body, images, videos, and display_format. Supports filtering by country, media_type, date range, and language with cursor-based pagination. Both GET and POST are supported. If the cursor becomes too large after extensive pagination, use POST and send the same parameters in the JSON body.",
    "properties": {
      "pageId": {
        "type": "string",
        "description": "The companies ad library page id. You can get this with my Search For Companies Endpoint. Can either use this or companyName"
      },
      "companyName": {
        "type": "string",
        "description": "The name of the company. Can either use this or pageId"
      },
      "country": {
        "type": "string",
        "description": "This can only be one country. It has to be the 2 letter code for the country. It defaults to ALL."
      },
      "status": {
        "type": "string",
        "description": "Status of the ad. Defaults to ACTIVE.",
        "enum": [
          "ALL",
          "ACTIVE",
          "INACTIVE"
        ]
      },
      "media_type": {
        "type": "string",
        "description": "Media type of the ad. Defaults to ALL. Meme refers to ads with image and text. Not sure why they call it meme.",
        "enum": [
          "ALL",
          "IMAGE",
          "VIDEO",
          "MEME",
          "IMAGE_AND_MEME",
          "NONE"
        ]
      },
      "language": {
        "type": "string",
        "description": "Language to filter ads on. Needs to be 2 letter language code, ie EN, ES, FR, etc"
      },
      "sort_by": {
        "type": "string",
        "description": "Sort by impressions (high to low), or Most Recent (relevancy_monthly_grouped). Defaults to impressions.",
        "enum": [
          "total_impressions",
          "relevancy_monthly_grouped"
        ]
      },
      "start_date": {
        "type": "string",
        "description": "Start date to search for. Format: YYYY-MM-DD"
      },
      "end_date": {
        "type": "string",
        "description": "End date to search for. Format: YYYY-MM-DD"
      },
      "trim": {
        "type": "boolean",
        "description": "Set to true for a trimmed down version of the response"
      },
      "cursor": {
        "type": "string",
        "description": "Cursor to paginate through results"
      }
    },
    "required": [],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `unknown` | Yes | — | Provider response payload. |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "description": "Provider response payload."
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0.02` per pricing unit.

## Related documentation

* [ScrapeCreators provider guide](https://deepline.com/docs/providers/scrapecreators/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.