# Facebook Advertisers (`shareze001/facebook-advertisers`) Actor

By acquiring a group of advertisers through keywords, you can obtain more precise ads by using advertiser IDs instead of keywords.
You can use actor: `shareze001/facebook-ads` to obtain ads placed by advertisers.

- **URL**: https://apify.com/shareze001/facebook-advertisers.md
- **Developed by:** [shareze](https://apify.com/shareze001) (community)
- **Categories:** E-commerce, Social media, Other
- **Features:** Full permissions
- **Stats:** 40 total users, 0 monthly users, 100.0% runs succeeded, 3 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

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 examples already wired to this Actor's own input schema, see the [API](#api) section below.

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`).

# README

## Facebook Advertisers Scraper

This Apify Actor is designed to scrape advertiser data from Facebook's Ad Library. It allows you to search for advertisers using a keyword and retrieve detailed information about their pages.

### How to Use

#### 1. Input Configuration

The Actor requires an input JSON object to define the scraping parameters. The structure of the input is as follows:

```json
{
  "keyword": "nike"
}
```

- **`keyword`**: (Required) The search keyword used to find advertisers. For example, "Nike Football".

#### 2. Output Data

The Actor returns an array of objects, where each object represents an advertiser's page. The structure of the output is as follows:

```json
[
  {
    "id": "123456789",
    "name": "Nike Football",
    "category": "Sports",
    "image_uri": "https://example.com/image.jpg",
    "likes": 1000000,
    "verification": true,
    "ig_username": "nikefootball",
    "ig_followers": 500000,
    "ig_verification": true
  }
]
```

- **`id`**: The unique ID of the advertiser's page.
- **`name`**: The name of the advertiser's page.
- **`category`**: The category of the advertiser's page.
- **`image_uri`**: The URL of the advertiser's profile image.
- **`likes`**: The number of likes on the advertiser's page.
- **`verification`**: Whether the advertiser's page is verified.
- **`ig_username`**: The Instagram username of the advertiser.
- **`ig_followers`**: The number of Instagram followers.
- **`ig_verification`**: Whether the Instagram account is verified.

#### 3. Running the Actor

1. Deploy the Actor on the Apify platform.
2. Provide the input JSON in the Actor's input configuration.
3. Run the Actor to scrape data.
4. The results will be available in the Actor's dataset.

#### 4. Example Use Case

To scrape data for the keyword "Nike Football":

1. Set the input as:
   ```json
   {
     "keyword": "nike"
   }
   ```
2. Run the Actor.
3. Retrieve the output dataset containing advertiser details.

### Notes

- This Actor uses Facebook's GraphQL API to fetch data.
- Ensure that the input keyword is relevant to the advertisers you want to scrape.
- The Actor is optimized for performance but may be subject to rate limits or restrictions imposed by Facebook.

# Actor input Schema

## `keyword` (type: `string`):

Search keyword

## Actor input object example

```json
{
  "keyword": "nike"
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "keyword": "nike"
};

// Run the Actor and wait for it to finish
const run = await client.actor("shareze001/facebook-advertisers").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "keyword": "nike" }

# Run the Actor and wait for it to finish
run = client.actor("shareze001/facebook-advertisers").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "keyword": "nike"
}' |
apify call shareze001/facebook-advertisers --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,shareze001/facebook-advertisers"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/BWofmzKbSbxSS0wqk/builds/AoW3XPXrpCjI3kw3A/openapi.json
