{
  "openapi": "3.0.1",
  "info": {
    "title": "Pinterest Ads Library Scraper - Ad Repository, Reach, Targeting",
    "description": "Scrape Pinterest ads from the public Pinterest Ads Repository (EU, NO, BR, TR) by advertiser, country or category: title, description, image/video, landing page, run dates, reach by country, age/gender/interest targeting. No login. $2 / 1,000 ads.",
    "version": "0.1",
    "x-build-id": "5INRXAWGy5r8abmcC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/adintel-labs~pinterest-ad-repository-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-adintel-labs-pinterest-ad-repository-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/adintel-labs~pinterest-ad-repository-scraper/runs": {
      "post": {
        "operationId": "runs-sync-adintel-labs-pinterest-ad-repository-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/adintel-labs~pinterest-ad-repository-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-adintel-labs-pinterest-ad-repository-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": {
          "advertisers": {
            "title": "Advertisers",
            "type": "array",
            "description": "Advertiser names as listed in the Pinterest Ads Repository (e.g. \"IKEA Deutschland\", \"adidas\"). Closest match is used if the name is not exact. Leave empty to browse all ads in the selected countries.",
            "items": {
              "type": "string"
            }
          },
          "countries": {
            "title": "Countries",
            "type": "array",
            "description": "2-letter codes where ads were shown: EU countries plus NO, BR, TR (e.g. DE, FR, IT). One request series per country.",
            "default": [
              "DE"
            ],
            "items": {
              "type": "string"
            }
          },
          "category": {
            "title": "Ad category",
            "enum": [
              "ALL",
              "ANIMALS",
              "ARCHITECTURE",
              "ART",
              "BEAUTY",
              "CHILDRENS_FASHION",
              "DESIGN",
              "DIY_AND_CRAFTS",
              "EDUCATION",
              "ELECTRONICS",
              "ENTERTAINMENT",
              "EVENT_PLANNING",
              "FINANCE",
              "FOOD_AND_DRINKS",
              "GARDENING",
              "HEALTH",
              "HOME_DECOR",
              "MENS_FASHION",
              "OTHER",
              "PARENTING",
              "QUOTES",
              "SPORT",
              "TRAVEL",
              "VEHICLES",
              "WEDDING",
              "WOMENS_FASHION"
            ],
            "type": "string",
            "description": "Pinterest ad category filter.",
            "default": "ALL"
          },
          "gender": {
            "title": "Targeted gender",
            "enum": [
              "ALL",
              "FEMALE",
              "MALE",
              "UNSPECIFIED"
            ],
            "type": "string",
            "description": "Only ads targeted at this gender.",
            "default": "ALL"
          },
          "dateFrom": {
            "title": "Shown from",
            "type": "string",
            "description": "Start of the period (YYYY-MM-DD). Default: 30 days ago. Long ranges are split into 30-day windows automatically (library keeps 12 months)."
          },
          "dateTo": {
            "title": "Shown until",
            "type": "string",
            "description": "End of the period (YYYY-MM-DD). Default: today."
          },
          "maxResults": {
            "title": "Max ads per advertiser / country",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum ads returned for EACH advertiser x country (or each country when browsing).",
            "default": 50
          },
          "includePinDetails": {
            "title": "Include pin details",
            "type": "boolean",
            "description": "Fetch each ad pin for the landing page URL, domain, advertiser profile, full-size image/video and creation date (1 extra request per ad).",
            "default": true
          },
          "includeAiAnalysis": {
            "title": "AI ad-angle analysis (extra event)",
            "type": "boolean",
            "description": "Adds aiAnalysis (angle, hook, offer, audience, emotional triggers, funnel stage) to each ad. Charged per successfully analysed ad only.",
            "default": false
          },
          "llmApiKey": {
            "title": "LLM API key (optional)",
            "type": "string",
            "description": "OpenAI-compatible API key. Leave empty to use the Actor's built-in key (if configured)."
          },
          "llmModel": {
            "title": "LLM model",
            "type": "string",
            "description": "Model name for the OpenAI-compatible endpoint.",
            "default": "gpt-4o-mini"
          },
          "llmBaseUrl": {
            "title": "LLM base URL",
            "type": "string",
            "description": "OpenAI-compatible base URL (OpenAI, OpenRouter, Groq, xAI...).",
            "default": "https://api.openai.com/v1"
          },
          "detailConcurrency": {
            "title": "Detail concurrency",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Parallel pin-detail requests.",
            "default": 4
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Pinterest's public repository endpoints work from Apify datacenter proxy (default); the Actor rotates sessions and auto-upgrades to RESIDENTIAL after repeated 403/429s.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}