{
  "openapi": "3.0.1",
  "info": {
    "title": "Amazon Ad Library Scraper — EU Ads Repository (DSA)",
    "description": "Scrape the Amazon Ad Library (EU DSA ad repository): advertiser, payer, delivery dates, reach per country and store, targeting methods, landing pages, video creatives and restricted ads for amazon.de, .fr, .it, .es, .nl, .pl, .se, .ie and .com.be.",
    "version": "0.1",
    "x-build-id": "Rme36OGWoy5zBvIV3"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/rastriq~amazon-ad-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-rastriq-amazon-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/rastriq~amazon-ad-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-rastriq-amazon-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/rastriq~amazon-ad-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-rastriq-amazon-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",
        "properties": {
          "searchTerms": {
            "title": "🔍 Search terms",
            "type": "array",
            "description": "Brands, sellers or products. Amazon matches each term against the <b>advertiser name and the ad text</b> (not the payer), ranked by relevance.<br><br>Examples: <code>PUMA</code>, <code>Vebon</code>, <code>Fire TV Stick</code><br><br>Leave empty to browse <b>all ads</b> of the period (use <b>Max ads</b>). Use <b>Advertiser match</b> below to keep only ads whose advertiser contains the term.",
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "💯 Max ads",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum number of ads in the dataset for the whole run. <b>0 = no limit</b> (a search is paginated to its last page).<br><br>Amazon holds hundreds of millions of ads; a search without terms over a long period is effectively endless — always set a limit for it.",
            "default": 1000
          },
          "marketplaces": {
            "title": "🌍 Marketplaces",
            "uniqueItems": true,
            "type": "array",
            "description": "Amazon EU stores to query. <b>All</b> runs one query across every store; selecting stores runs one query per store and merges results (an ad shown in several stores is delivered once).",
            "items": {
              "type": "string",
              "enum": [
                "ALL",
                "DE",
                "FR",
                "IT",
                "ES",
                "NL",
                "BE",
                "PL",
                "SE",
                "IE"
              ],
              "enumTitles": [
                "🇪🇺 All EU stores",
                "🇩🇪 amazon.de",
                "🇫🇷 amazon.fr",
                "🇮🇹 amazon.it",
                "🇪🇸 amazon.es",
                "🇳🇱 amazon.nl",
                "🇧🇪 amazon.com.be",
                "🇵🇱 amazon.pl",
                "🇸🇪 amazon.se",
                "🇮🇪 amazon.ie"
              ]
            },
            "default": [
              "ALL"
            ]
          },
          "startDate": {
            "title": "📅 From",
            "type": "string",
            "description": "Ads <b>delivered at any time</b> in the period are returned, including long-running ads that started earlier. Absolute (<code>2026-01-01</code>) or relative (<code>30 days</code>, <code>6 months</code>).",
            "default": "30 days"
          },
          "endDate": {
            "title": "📅 To",
            "type": "string",
            "description": "End of the period. Empty = today."
          },
          "adIds": {
            "title": "🆔 Ad IDs",
            "type": "array",
            "description": "Fetch specific ads by their Amazon Ad Library id (the <code>ad_id</code> field, or the last part of <code>amazon.de/adlibrary/detail/&lt;id&gt;</code>). Can be combined with search terms.",
            "items": {
              "type": "string"
            }
          },
          "advertiserMatch": {
            "title": "Advertiser match",
            "enum": [
              "any",
              "contains",
              "exact"
            ],
            "type": "string",
            "description": "<b>As returned by Amazon</b> keeps every result (the term may only appear in the ad text — those rows get the flag <code>advertiser_not_matching_query</code>).<br><b>Advertiser contains the term</b> keeps only ads whose advertiser name contains it.<br><b>Exact advertiser</b> keeps only an exact (case-insensitive) match.",
            "default": "any"
          },
          "payerFilter": {
            "title": "Payer contains",
            "type": "array",
            "description": "Keep only ads whose payer contains any of these texts (case-insensitive), e.g. <code>GmbH</code> or a legal entity name. Amazon cannot search by payer, so combine it with search terms.",
            "items": {
              "type": "string"
            }
          },
          "adTypes": {
            "title": "Ad types",
            "uniqueItems": true,
            "type": "array",
            "description": "<b>Ads</b> = sponsored ads. <b>Commercial communications</b> = affiliate / influencer content Amazon discloses under the DSA (no payer, reach or end date).",
            "items": {
              "type": "string",
              "enum": [
                "AD",
                "AFFILIATE_MARKETING_CONTENT"
              ],
              "enumTitles": [
                "📢 Ads",
                "🤝 Commercial communications (affiliate content)"
              ]
            },
            "default": [
              "AD",
              "AFFILIATE_MARKETING_CONTENT"
            ]
          },
          "restrictedAds": {
            "title": "Restricted ads",
            "enum": [
              "exclude",
              "include",
              "only"
            ],
            "type": "string",
            "description": "Ads Amazon removed or restricted for policy reasons (DSA moderation), with the restriction category and whether detection was automated; advertiser and payer are usually withheld.<br><br>⚠️ Amazon does not allow text search on restricted ads: they are listed <b>per marketplace and period</b>, ignoring search terms (use <b>Max ads</b>).",
            "default": "exclude"
          },
          "outputFormat": {
            "title": "📄 Output format",
            "enum": [
              "flat",
              "nested"
            ],
            "type": "string",
            "description": "<b>Flat</b> (default): every value in its own column — lists become comma-separated text, reach per country becomes <code>reach_min_DE</code> / <code>reach_max_DE</code> columns, and art. 39 coverage becomes <code>art39_ratio</code> / <code>art39_missing</code>.<br><br><b>Nested</b>: keeps the source's original objects and lists (e.g. the full per-language variations or per-country breakdown) for programmatic use.",
            "default": "flat"
          },
          "mediaMode": {
            "title": "🎬 Creative media",
            "enum": [
              "reference",
              "signed",
              "download"
            ],
            "type": "string",
            "description": "Amazon serves video/audio/image creatives through <b>signed links that expire after 30 minutes</b>.<br><br>• <b>Reference</b> — stable link without the signature (identifies the file; not downloadable)<br>• <b>Signed link</b> — downloadable for ~30 min after the run (<code>media[].expiresAt</code>)<br>• <b>Download</b> — saves each file to the run's key-value store and links it in <code>creative_urls</code>. Charged per file.",
            "default": "reference"
          },
          "maxMediaMb": {
            "title": "Max file size",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Skip downloads larger than this (flag <code>media_too_large_not_downloaded</code>). Only with <b>Download files</b>.",
            "default": 50
          },
          "hashPersonalNames": {
            "title": "🔒 Pseudonymise personal names",
            "type": "boolean",
            "description": "Some advertisers and payers are private individuals (sole traders, authors, influencers). Every such row is flagged with <code>is_natural_person_suspected</code>. Turn this on to also replace those names with a stable SHA-256 pseudonym (<code>sha256:…</code>) in both the base and the native fields.",
            "default": false
          },
          "maxItemsPerQuery": {
            "title": "Max ads per search",
            "minimum": 0,
            "type": "integer",
            "description": "Cap for each search term × marketplace. 0 = no cap (only <b>Max ads</b> applies).",
            "default": 0
          },
          "proxyConfiguration": {
            "title": "🔒 Proxy",
            "type": "object",
            "description": "Not needed normally. Each retry already starts a new session."
          },
          "maxConcurrency": {
            "title": "Parallel searches",
            "minimum": 1,
            "maximum": 2,
            "type": "integer",
            "description": "Searches run in parallel (requests are still spaced by <b>Request delay</b>).",
            "default": 1
          },
          "requestDelayMs": {
            "title": "⏱️ Request delay",
            "minimum": 1000,
            "maximum": 10000,
            "type": "integer",
            "description": "Pause between requests to Amazon (randomised ±30 %). Minimum 1000 ms.",
            "default": 1500
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Retries for temporary errors (429/5xx/blocked page), each with exponential backoff and a fresh session.",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}