{
  "openapi": "3.0.1",
  "info": {
    "title": "Meta Ad Library & Facebook Ad Library Checker",
    "description": "Facebook Ads Library checker: see whether a Facebook Page or brand runs ads, its ad count, the day its latest ad started, and its latest ads with text, links and dates. Enter Page links, IDs or brand names; a Page with no ads is answered too.",
    "version": "0.1",
    "x-build-id": "9UoU2ZTm637vsX7Go"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kaleidoscopelabs~facebook-ads-library-checker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kaleidoscopelabs-facebook-ads-library-checker",
        "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/kaleidoscopelabs~facebook-ads-library-checker/runs": {
      "post": {
        "operationId": "runs-sync-kaleidoscopelabs-facebook-ads-library-checker",
        "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/kaleidoscopelabs~facebook-ads-library-checker/run-sync": {
      "post": {
        "operationId": "run-sync-kaleidoscopelabs-facebook-ads-library-checker",
        "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": {
          "pages": {
            "title": "Facebook Page links or IDs",
            "type": "array",
            "description": "One per line: a Page's numeric ID or an Ad Library link of a Page (with view_all_page_id), which go straight to that Page; or a Facebook Page link (facebook.com/<name>), whose Page is looked up by its username, never another Page: when it can't be found, the record says so and is not charged. An Ad Library link's own filters apply to its line (country, ad status, media type, platforms, languages, start dates), over the ones below; a filter it leaves out is the one below. A line that is none of these, or a link with a filter the run does not apply, is skipped, not charged, and its record says why.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "names": {
            "title": "Brand or Page names",
            "type": "array",
            "description": "One per line: a brand or a Page's name, as you would type it in the Ad Library's search box: a best match, the first Page the library suggests with that name (accents, punctuation and a legal form such as Inc aside), verified or not; the record says how sure the match is. A name no Page carries is answered so. For a sure answer, enter the Page link.",
            "items": {
              "type": "string"
            }
          },
          "country": {
            "title": "Country",
            "pattern": "^([A-Za-z]{2}|ALL|all)$",
            "type": "string",
            "description": "Where the ads ran: a two-letter country code such as US or DE, or ALL for anywhere.",
            "default": "ALL"
          },
          "activeOnly": {
            "title": "Only ads running now",
            "type": "boolean",
            "description": "On: the ads running now. Off: ended ads too.",
            "default": true
          },
          "adsPerPage": {
            "title": "Latest ads per Page",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "How many of a Page's latest ads its record carries, 0 to 1,000 (30 with a monitor); each costs one ad. Past 30 the Page's list is read further, about 5 seconds for every 10 more ads. Left empty: 3 for a lookup and a monitor's first run of a Page, then up to 30 new ads a run. 0 returns no ads: whether it runs ads, the count and the latest start day are read either way, and with a monitor, 0 counts the new ads and returns none."
          },
          "monitorName": {
            "title": "Monitor name",
            "type": "string",
            "description": "Name a monitor (letters, digits, hyphens) to get, on every run, only the ads new since its last run, with newAds and changed on each record. Each Page's first run returns its latest ads, as a lookup does. Leave empty for plain lookups."
          },
          "includePersonPages": {
            "title": "Pages of persons",
            "type": "boolean",
            "description": "On: the name, link, categories and likes of Pages whose category is one persons use (a public figure, a creator, an artist). Off, those Pages' records keep whether they run ads, the count, the latest start and the ads, without naming the Page; a Page whose category can't be read is treated as a person's. Personal data under the GDPR: turn it on only with a lawful basis of your own.",
            "default": false
          },
          "includeCreators": {
            "title": "Creators of partnership ads",
            "type": "boolean",
            "description": "On: the Page of the creator a partnership ad is shown under. Personal data under the GDPR: turn it on only with a lawful basis of your own.",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}