{
  "openapi": "3.0.1",
  "info": {
    "title": "Ad Spender Detector — Facebook & Instagram Ad Library Scraper",
    "description": "Facebook Ad Library scraper that finds businesses running Facebook & Instagram ads. Proof-of-budget B2B leads with a spend-signal score and contact emails.",
    "version": "0.1",
    "x-build-id": "aUY0cdTyUjia6w9KH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jurassic_jove~facebook-ad-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jurassic_jove-facebook-ad-library-scraper",
        "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/jurassic_jove~facebook-ad-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-jurassic_jove-facebook-ad-library-scraper",
        "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/jurassic_jove~facebook-ad-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-jurassic_jove-facebook-ad-library-scraper",
        "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",
        "required": [
          "searchTerms"
        ],
        "properties": {
          "searchTerms": {
            "title": "Search terms (niche keywords)",
            "type": "array",
            "description": "Niche keywords to search in the Ad Library — the kind of business you want to find spending on ads. Add several to widen the net; advertisers matching more than one term are delivered once and tagged with every term they matched. Examples: \"roof repair\", \"med spa\", \"personal injury lawyer\", \"dental implants\".",
            "items": {
              "type": "string"
            }
          },
          "country": {
            "title": "Country",
            "enum": [
              "US",
              "CA",
              "GB",
              "IE",
              "AU",
              "NZ",
              "DE",
              "FR",
              "ES",
              "IT",
              "NL",
              "BE",
              "AT",
              "CH",
              "PT",
              "SE",
              "NO",
              "DK",
              "FI",
              "PL",
              "BR",
              "MX",
              "AR",
              "CO",
              "CL",
              "PE",
              "IN",
              "SG",
              "AE",
              "SA",
              "ZA",
              "PH",
              "ID",
              "MY",
              "TH",
              "JP",
              "KR"
            ],
            "type": "string",
            "description": "Ad Library region (ISO alpha-2 country code). The Ad Library is country-scoped: results are ads shown to people in this country.",
            "default": "US"
          },
          "platforms": {
            "title": "Platforms",
            "type": "array",
            "description": "Which Meta platforms the ad must run on. Leave all selected (default) to include every placement. An advertiser is kept if any of its active ads runs on any selected platform.",
            "items": {
              "type": "string",
              "enum": [
                "facebook",
                "instagram",
                "audience_network",
                "messenger"
              ],
              "enumTitles": [
                "Facebook",
                "Instagram",
                "Audience Network",
                "Messenger"
              ]
            },
            "default": [
              "facebook",
              "instagram",
              "audience_network",
              "messenger"
            ]
          },
          "activeStatus": {
            "title": "Ad status",
            "enum": [
              "active",
              "all"
            ],
            "type": "string",
            "description": "\"Active only\" (default) returns advertisers with ads running right now — the strongest live buying signal. \"All (active + inactive)\" also includes advertisers whose ads recently stopped.",
            "default": "active"
          },
          "minActiveAds": {
            "title": "Minimum active ads",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Only include advertisers running at least this many distinct active ads. Higher = bigger spender (an advertiser running 8 ads is testing creative and scaling, not dabbling). 1 = every advertiser with at least one ad.",
            "default": 1
          },
          "maxAdvertisers": {
            "title": "Max advertisers",
            "minimum": 1,
            "maximum": 300,
            "type": "integer",
            "description": "Maximum number of UNIQUE advertisers to fully process and deliver, across all search terms combined. Strictly enforced to bound cost and block exposure. Hard cap 300.",
            "default": 50
          },
          "extractEmails": {
            "title": "Extract contact emails from landing pages",
            "type": "boolean",
            "description": "Follow each advertiser's landing/page domains and extract contact emails through the reused email-extraction pipeline (plain text, mailto:, and Cloudflare-obfuscated). Charged only when the pipeline actually runs for an advertiser (a domain was found and visited). Turn off to get advertiser + spend-signal data only.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify proxy used for landing-page email extraction. RESIDENTIAL is recommended for the best reach and lowest block rate. The Ad Library search itself is delegated to a maintained upstream Actor and does not use this proxy.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          },
          "adLibraryActorId": {
            "title": "Upstream Ad Library Actor (advanced)",
            "type": "string",
            "description": "The Apify Actor used to fetch raw ads from the public Ad Library. Defaults to a maintained community Actor. Its per-ad fee is billed to YOUR Apify account, in addition to this Actor's per-advertiser fee. Override only if you prefer a different Ad Library source."
          },
          "maxAdsScannedPerTerm": {
            "title": "Max ads scanned per term (advanced)",
            "minimum": 20,
            "maximum": 5000,
            "type": "integer",
            "description": "Upper bound on how many raw ads the upstream Actor fetches per search term before aggregation. Bounds upstream cost. The Actor stops early once maxAdvertisers unique advertisers are collected. Leave at default unless you are tuning cost vs. coverage."
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}