{
  "openapi": "3.0.1",
  "info": {
    "title": "Meta Ad Scraper",
    "description": "Meta Ad Scraper extracts profile input, profile name, ad archive id, ad library url, is active, start date, end date, page name, page like count, link url, cta text, images, impressions, spend for every row. Inputs: profile links, usernames, platform filter, ad status filter, ads per profile.",
    "version": "0.0",
    "x-build-id": "KasshAcK6qkQP2TQN"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlix~meta-ad-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlix-meta-ad-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/crawlix~meta-ad-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlix-meta-ad-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/crawlix~meta-ad-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlix-meta-ad-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",
        "properties": {
          "facebook_urls": {
            "title": "Profile Links",
            "type": "array",
            "description": "Links of the Facebook profiles or pages whose ads you want. Accepted links:\n- https://www.facebook.com/nike\n- a link with a tab, such as https://www.facebook.com/nike/videos\n- https://www.facebook.com/profile.php?id=100044541544829\n- https://www.facebook.com/people/Nike/100044541544829\n- an Ad Library link of a page\n\nEach profile is collected on its own and every ad shows which profile it came from.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "username": {
            "title": "Usernames",
            "type": "array",
            "description": "Facebook usernames of the profiles or pages whose ads you want, for example nike or cocacola. One per line. Type each one exactly as it appears in the profile link after facebook.com/, including any dots, for example Ghorerbazarbd.comm. They work exactly like profile links. The run log and every result show the page name found for each username, so you can check it is the right page.",
            "items": {
              "type": "string"
            }
          },
          "platform": {
            "title": "Platform ($)",
            "enum": [
              "all",
              "instagram",
              "facebook",
              "messenger",
              "audience_network",
              "whatsapp",
              "threads"
            ],
            "type": "string",
            "description": "Only collect ads that run on this platform. Choose All platforms to collect every platform. Choosing a specific platform adds a small extra charge for each ad collected, shown on the pricing tab.",
            "default": "all"
          },
          "active_status": {
            "title": "Ad Status ($)",
            "enum": [
              "all",
              "active",
              "inactive"
            ],
            "type": "string",
            "description": "Collect ads that are still running, ads that have stopped, or both. Choosing Active only or Inactive only adds a small extra charge for each ad collected, shown on the pricing tab.",
            "default": "all"
          },
          "max_ads": {
            "title": "Ads per Profile",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of unique ads to collect for each profile. Set it as high as you like: the run for a profile stops by itself when Facebook has no more ads for it, and keeps everything it collected. The same ad is never counted twice, so you receive exactly this many different ads whenever that many are available. A free Apify account collects up to 50 ads in total per run, across all profiles; a paid plan has no limit.",
            "default": 10
          },
          "proxyCountry": {
            "title": "Connection Country",
            "enum": [
              "US",
              "GB",
              "AU",
              "CA",
              "DE",
              "FR",
              "NL",
              "IT",
              "ES",
              "SE",
              "NO",
              "DK",
              "FI",
              "BE",
              "AT",
              "CH",
              "IE",
              "PL",
              "PT",
              "CZ",
              "HU",
              "RO",
              "GR",
              "JP",
              "KR",
              "SG",
              "IN",
              "BR",
              "MX",
              "AR",
              "TR",
              "AF",
              "AL",
              "DZ",
              "AO",
              "AM",
              "AZ",
              "BS",
              "BH",
              "BD",
              "BB",
              "BY",
              "BZ",
              "BJ",
              "BO",
              "BA",
              "BW",
              "BN",
              "BG",
              "BF",
              "KH",
              "CM",
              "CL",
              "CN",
              "CO",
              "CG",
              "CR",
              "HR",
              "CU",
              "CY",
              "CD",
              "DO",
              "EC",
              "EG",
              "SV",
              "EE",
              "ET",
              "FJ",
              "GA",
              "GE",
              "GH",
              "GT",
              "GN",
              "GY",
              "HT",
              "HN",
              "HK",
              "IS",
              "ID",
              "IR",
              "IQ",
              "IL",
              "CI",
              "JM",
              "JO",
              "KZ",
              "KE",
              "KW",
              "KG",
              "LA",
              "LV",
              "LB",
              "LR",
              "LY",
              "LT",
              "LU",
              "MG",
              "MW",
              "MY",
              "MV",
              "ML",
              "MT",
              "MU",
              "MD",
              "MN",
              "ME",
              "MA",
              "MZ",
              "MM",
              "NA",
              "NP",
              "NZ",
              "NI",
              "NE",
              "NG",
              "MK",
              "OM",
              "PK",
              "PS",
              "PA",
              "PG",
              "PY",
              "PE",
              "PH",
              "PR",
              "QA",
              "RU",
              "RW",
              "SA",
              "SN",
              "RS",
              "SL",
              "SK",
              "SI",
              "SO",
              "ZA",
              "LK",
              "SD",
              "SR",
              "SY",
              "TW",
              "TJ",
              "TZ",
              "TH",
              "TG",
              "TT",
              "TN",
              "TM",
              "UG",
              "UA",
              "AE",
              "UY",
              "UZ",
              "VE",
              "VN",
              "YE",
              "ZM",
              "ZW"
            ],
            "type": "string",
            "description": "The country your run connects from. Pick the one closest to the market you are researching. If a country is not available right now, the run connects from the United States instead and the log says so.",
            "default": "US"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}