{
  "openapi": "3.0.1",
  "info": {
    "title": "Facebook Advertisers Leads API | Meta Ad Library + Emails",
    "description": "Facebook advertisers as leads: find businesses running ads in the Meta Ad Library and get their e-mail, phone and a landing page audit showing what their site is missing. $0.04 per lead.",
    "version": "0.1",
    "x-build-id": "DUAf2YcuRvNNCktQP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/berkaydev~meta-ad-library-lead-finder/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-berkaydev-meta-ad-library-lead-finder",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/berkaydev~meta-ad-library-lead-finder/runs": {
      "post": {
        "operationId": "runs-sync-berkaydev-meta-ad-library-lead-finder",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/berkaydev~meta-ad-library-lead-finder/run-sync": {
      "post": {
        "operationId": "run-sync-berkaydev-meta-ad-library-lead-finder",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "queries": {
            "title": "What are they advertising?",
            "type": "array",
            "description": "Required. Search terms, one per line — the same words you would type into the Meta Ad Library. `zahnarzt`, `dentist`, `fitness studio`, `roofing`. Every business currently running ads for that term becomes a lead.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "Two-letter country codes. Ads are indexed per country, so each one is a separate search — and each one adds advertisers.",
            "default": [
              "DE"
            ],
            "items": {
              "type": "string"
            }
          },
          "activeOnly": {
            "title": "Only ads running right now",
            "type": "boolean",
            "description": "On by default: a business paying for ads today is a warmer lead than one that stopped last year. Turn it off to reach further back and find more advertisers.",
            "default": true
          },
          "onlyNew": {
            "title": "Only new advertisers",
            "type": "boolean",
            "description": "Remembers which advertisers this search already delivered and returns only ones you have not seen. Schedule it weekly to learn which businesses just started advertising. Known advertisers are skipped before their website is audited, so they cost nothing.",
            "default": false
          },
          "baselineOnly": {
            "title": "Only set a starting point (free)",
            "type": "boolean",
            "description": "Remembers every advertiser the search finds today and delivers nothing, so nothing is audited or charged. Afterwards, run the same search with 'Only new advertisers' on a schedule and you get only businesses that start advertising after today.",
            "default": false
          },
          "seenStoreName": {
            "title": "Memory name",
            "type": "string",
            "description": "Named key-value store in your account that keeps the memory for onlyNew. Each search (terms + countries) has its own memory inside it; entries older than 180 days are forgotten.",
            "default": "meta-advertisers-seen"
          },
          "skipBigAdvertisers": {
            "title": "Skip large advertisers",
            "type": "boolean",
            "description": "A domain running many separate ads is a brand with a media budget, not a local business you can sell a website to. This drops them automatically — far more reliable than any list of brand names.",
            "default": true
          },
          "bigAdvertiserThreshold": {
            "title": "How many ads counts as large",
            "minimum": 2,
            "type": "integer",
            "description": "A domain with at least this many ads in the run is treated as a large advertiser. Raise it if your niche is dominated by chains and you are losing real leads.",
            "default": 4
          },
          "relevanceFilter": {
            "title": "Keep only advertisers actually in this trade",
            "enum": [
              "strict",
              "loose",
              "off"
            ],
            "type": "string",
            "description": "The Ad Library matches ad wording, not industry — searching `physiotherapie` also returns pet shops, insurers and hotels whose ads happen to mention the word. `strict` keeps an advertiser only if the trade appears in their domain, page title, an H1 or the meta description — what a business says it *is*. `loose` also accepts a mention anywhere on the page, which is what let the hotels through. `off` returns everything and lets you filter yourself.",
            "default": "strict"
          },
          "auditWebsite": {
            "title": "Audit the landing page",
            "type": "boolean",
            "description": "This is the point of the Actor. Opens the page the advertiser is paying to send traffic to and reads e-mail, phone, CMS, SSL, mobile layout, copyright year, analytics, socials and contact form — then scores the lead.",
            "default": true
          },
          "maxContactPages": {
            "title": "Contact pages to check per site",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "If the landing page has no contact details, the Actor follows the contact link and probes the usual paths. Set to 0 to read the landing page only.",
            "default": 5
          },
          "maxAdvertisersPerSearch": {
            "title": "Max advertisers per search",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Upper bound per search term and country.",
            "default": 50
          },
          "maxScrolls": {
            "title": "How far to scroll the library (advanced)",
            "minimum": 3,
            "maximum": 40,
            "type": "integer",
            "description": "The library stops producing new advertisers after a while; the Actor detects that and moves on. Raising this rarely helps.",
            "default": 15
          },
          "maxConcurrency": {
            "title": "Landing pages fetched in parallel",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Higher is faster, lower is gentler on the sites you visit.",
            "default": 6
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Not needed for the Ad Library itself, and not needed for most landing pages. Some hosts — more often in the US — refuse datacenter addresses and answer 403. Those rows say so and carry no findings.",
            "default": {
              "useApifyProxy": false
            }
          },
          "compact": {
            "title": "Compact rows (for AI / LLM use)",
            "type": "boolean",
            "description": "Return only rootDomain, landingUrl, email, phone, contactabilityScore, leadPriority, opportunityTags, outreachHook and statusNote per advertiser. Smaller rows for language-model context windows.",
            "default": false
          },
          "maxRunTimeSecs": {
            "title": "Max run time (seconds)",
            "minimum": 60,
            "maximum": 3500,
            "type": "integer",
            "description": "The run stops cleanly before this limit and keeps everything found so far.",
            "default": 3000
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}