{
  "openapi": "3.0.1",
  "info": {
    "title": "Pinterest Ads Library Scraper",
    "description": "Scrape ad campaigns from the Pinterest Ads Library by keyword or advertiser ID and country, including advertiser names, ad titles, media URLs, status, and targeting country.",
    "version": "1.1",
    "x-build-id": "SLxepks8UN4tKlYYq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/w3crawler~pinterest-ads-library-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-w3crawler-pinterest-ads-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/w3crawler~pinterest-ads-library-scraper/runs": {
      "post": {
        "operationId": "runs-sync-w3crawler-pinterest-ads-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/w3crawler~pinterest-ads-library-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-w3crawler-pinterest-ads-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": {
          "advertiserName": {
            "title": "Advertiser name",
            "maxLength": 120,
            "type": "string",
            "description": "Optional public repository advertiser filter. The legacy query alias is accepted by the runtime."
          },
          "query": {
            "title": "Legacy advertiser query",
            "maxLength": 120,
            "type": "string",
            "description": "Backward-compatible alias for advertiserName. Do not supply both fields."
          },
          "country": {
            "title": "Country",
            "enum": [
              "AT",
              "BE",
              "BR",
              "BG",
              "HR",
              "CY",
              "CZ",
              "DK",
              "EE",
              "FI",
              "FR",
              "DE",
              "GR",
              "HU",
              "IE",
              "IT",
              "LV",
              "LT",
              "LU",
              "MT",
              "NL",
              "NO",
              "PL",
              "PT",
              "RO",
              "SK",
              "SI",
              "ES",
              "SE",
              "TR"
            ],
            "type": "string",
            "description": "Pinterest Ads Repository country code.",
            "default": "FR"
          },
          "startDate": {
            "title": "Start date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "Start of the date window forwarded to Pinterest's Ads Repository API in YYYY-MM-DD format. Defaults to five days before the run."
          },
          "endDate": {
            "title": "End date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "type": "string",
            "description": "End of the date window forwarded to Pinterest's Ads Repository API in YYYY-MM-DD format. Defaults to the run date; the target currently accepts at most 30 days."
          },
          "vertical": {
            "title": "Ad category",
            "maxLength": 60,
            "type": "string",
            "description": "Optional Pinterest ad vertical, for example BEAUTY or HOME_DECOR. The legacy category alias is accepted by the runtime."
          },
          "category": {
            "title": "Legacy ad category",
            "maxLength": 60,
            "type": "string",
            "description": "Backward-compatible alias for vertical. Do not supply both fields."
          },
          "gender": {
            "title": "Gender",
            "enum": [
              "FEMALE",
              "MALE",
              "UNSPECIFIED"
            ],
            "type": "string",
            "description": "Optional audience gender filter."
          },
          "ageBucket": {
            "title": "Age bucket",
            "enum": [
              "AGE_18_24",
              "AGE_25_34",
              "AGE_35_44",
              "AGE_45_49",
              "AGE_50_54",
              "AGE_55_64",
              "AGE_65_PLUS"
            ],
            "type": "string",
            "description": "Optional audience age bucket using the repository API value."
          },
          "maxItems": {
            "title": "Maximum ads",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Global maximum of normal ad records emitted across all bookmark pages.",
            "default": 10
          },
          "maxPages": {
            "title": "Maximum pages",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum Ads Repository bookmark pages fetched for this run.",
            "default": 3
          },
          "includePinDetails": {
            "title": "Enrich with public Pin details",
            "type": "boolean",
            "description": "When enabled, bounded public Pin detail requests add outbound links, attribution, media metadata, and fallback creative text.",
            "default": true
          },
          "maxDetailItems": {
            "title": "Maximum detail requests",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum Pin detail requests; set to 0 to disable detail requests while keeping includePinDetails true.",
            "default": 10
          },
          "requestDelayMs": {
            "title": "Delay between pages (ms)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Respectful delay before each page after the first.",
            "default": 250
          },
          "maxConcurrency": {
            "title": "Maximum concurrency",
            "minimum": 1,
            "maximum": 2,
            "type": "integer",
            "description": "Bounded browser concurrency. The Ads Repository uses one source request, so 1 is recommended.",
            "default": 1
          },
          "maxRequestRetries": {
            "title": "Maximum request retries",
            "minimum": 0,
            "maximum": 3,
            "type": "integer",
            "description": "Bounded Crawlee retries for failed page navigation.",
            "default": 1
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 10,
            "maximum": 180,
            "type": "integer",
            "description": "Bounded navigation and handler timeout.",
            "default": 60
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional standard Apify Proxy configuration. It is wired into the Playwright crawler; proxy credentials are never written to output.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}