{
  "openapi": "3.0.1",
  "info": {
    "title": "X Ads Repository Scraper & Competitor Monitor",
    "description": "Extract current ads served on X across European markets and emit only new, changed, or removed competitor campaigns on scheduled runs. No X login or developer key required.",
    "version": "0.1",
    "x-build-id": "sRwrZIF7R9RUd6pL7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lexxer~x-ads-repository-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lexxer-x-ads-repository-monitor",
        "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/lexxer~x-ads-repository-monitor/runs": {
      "post": {
        "operationId": "runs-sync-lexxer-x-ads-repository-monitor",
        "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/lexxer~x-ads-repository-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-lexxer-x-ads-repository-monitor",
        "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": [
          "advertisers"
        ],
        "properties": {
          "advertisers": {
            "title": "Advertiser handles",
            "minItems": 1,
            "maxItems": 50,
            "type": "array",
            "description": "X handles, profile URLs, or @handles. Up to 50 per run.",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Markets",
            "type": "array",
            "description": "Countries covered by X's Ads Repository. Use two-letter codes.",
            "items": {
              "type": "string",
              "enum": [
                "AT",
                "BE",
                "BG",
                "HR",
                "CY",
                "CZ",
                "DK",
                "EE",
                "FI",
                "FR",
                "DE",
                "GR",
                "HU",
                "IS",
                "IE",
                "IT",
                "LV",
                "LI",
                "LT",
                "LU",
                "MT",
                "NL",
                "NO",
                "PL",
                "PT",
                "RO",
                "SK",
                "SI",
                "ES",
                "SE",
                "CH",
                "GB"
              ],
              "enumTitles": [
                "Austria",
                "Belgium",
                "Bulgaria",
                "Croatia",
                "Cyprus",
                "Czechia",
                "Denmark",
                "Estonia",
                "Finland",
                "France",
                "Germany",
                "Greece",
                "Hungary",
                "Iceland",
                "Ireland",
                "Italy",
                "Latvia",
                "Liechtenstein",
                "Lithuania",
                "Luxembourg",
                "Malta",
                "Netherlands",
                "Norway",
                "Poland",
                "Portugal",
                "Romania",
                "Slovakia",
                "Slovenia",
                "Spain",
                "Sweden",
                "Switzerland",
                "United Kingdom"
              ]
            },
            "default": [
              "FR",
              "DE"
            ]
          },
          "marketPreset": {
            "title": "Market preset",
            "enum": [
              "custom",
              "dach",
              "nordics",
              "uk-ireland",
              "all-supported"
            ],
            "type": "string",
            "description": "Choose a ready-made region or Custom to use the Markets field above.",
            "default": "custom"
          },
          "startDate": {
            "title": "Start date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Inclusive delivery date in YYYY-MM-DD format. Current repository data begins in 2023."
          },
          "endDate": {
            "title": "End date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Inclusive delivery date in YYYY-MM-DD format. Leave empty through the API to use today."
          },
          "outputMode": {
            "title": "Output mode",
            "enum": [
              "snapshot",
              "changes"
            ],
            "type": "string",
            "description": "Snapshot returns every current ad. Changes returns only NEW, CHANGED, and REMOVED ads compared with prior runs using the same monitor key.",
            "default": "snapshot"
          },
          "monitorKey": {
            "title": "Monitor key",
            "pattern": "^[A-Za-z0-9_-]{1,80}$",
            "type": "string",
            "description": "Optional stable name for scheduled change tracking, such as apple-eu. A deterministic key is generated when omitted."
          },
          "maxAdsPerAdvertiser": {
            "title": "Maximum ads per advertiser",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Safety cap applied after X returns the current result set.",
            "default": 1000
          },
          "searchTerms": {
            "title": "Creative or targeting keywords",
            "maxItems": 25,
            "type": "array",
            "description": "Optional case-insensitive terms. A row is returned when its creative, advertiser, or targeting contains any term.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "minImpressions": {
            "title": "Minimum impressions",
            "minimum": 0,
            "maximum": 10000000000,
            "type": "integer",
            "description": "Return ads with at least this many disclosed impressions.",
            "default": 0
          },
          "minReach": {
            "title": "Minimum reach",
            "minimum": 0,
            "maximum": 10000000000,
            "type": "integer",
            "description": "Return ads with at least this much disclosed reach.",
            "default": 0
          },
          "sortBy": {
            "title": "Sort results",
            "enum": [
              "impressions-desc",
              "reach-desc",
              "newest",
              "advertiser"
            ],
            "type": "string",
            "description": "Choose the order of emitted rows.",
            "default": "impressions-desc"
          },
          "concurrency": {
            "title": "Parallel advertisers",
            "minimum": 1,
            "maximum": 3,
            "type": "integer",
            "description": "The conservative default reduces X over-capacity errors.",
            "default": 1
          },
          "requestDelayMs": {
            "title": "Delay between requests",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Milliseconds between public X requests. Increase this if X reports over-capacity errors.",
            "default": 750
          },
          "maxRetries": {
            "title": "Temporary-error retries",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Retries timeouts, rate limits, and X over-capacity responses with exponential backoff.",
            "default": 4
          },
          "enrichCreatives": {
            "title": "Add ad text and author",
            "type": "boolean",
            "description": "Resolve each unique public tweet through X's oEmbed service. Adds requests but produces much more useful competitor intelligence.",
            "default": true
          },
          "includeCreativeHtml": {
            "title": "Include embed HTML",
            "type": "boolean",
            "description": "Add X's complete oEmbed HTML. Leave disabled for compact datasets.",
            "default": false
          },
          "includeDebugFields": {
            "title": "Include raw debug fields",
            "type": "boolean",
            "description": "Advanced option. Adds X's raw debug payloads and can make dataset rows much larger.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}