{
  "openapi": "3.0.1",
  "info": {
    "title": "OLX Car Scraper — Poland Car Listings",
    "description": "Scrape car listings from OLX — make, model, year, mileage, price, and photos. Includes seller contact details and city/region location, plus incremental price-drop tracking across runs.",
    "version": "0.1",
    "x-build-id": "bm2qtsetsGJwX2BQ5"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/blackfalcondata~olx-car-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-blackfalcondata-olx-car-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/blackfalcondata~olx-car-scraper/runs": {
      "post": {
        "operationId": "runs-sync-blackfalcondata-olx-car-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/blackfalcondata~olx-car-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-blackfalcondata-olx-car-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": {
          "country": {
            "title": "🌍 Country",
            "enum": [
              "PL"
            ],
            "type": "string",
            "description": "OLX country site to scrape. Poland (olx.pl) only for the passenger-car vertical in this release.",
            "default": "PL"
          },
          "query": {
            "title": "🔍 Search Term(s)",
            "type": "string",
            "description": "Free-text keyword(s) matched against listing titles (e.g. \"uszkodzony\", \"zamiana\", \"faktura VAT\"). Use a JSON array [\"q1\", \"q2\"] to batch multiple keywords in one run. Leave empty to browse the full market or rely on the structured filters below."
          },
          "startUrls": {
            "title": "🔗 Search-Result URLs",
            "type": "array",
            "description": "Paste an OLX car search-results URL straight from your browser (e.g. olx.pl/motoryzacja/samochody/... with any filters already applied in the URL). Each URL becomes its own task; results merge and dedupe with everything else in the run.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "make": {
            "title": "🚗 Make",
            "type": "array",
            "description": "Vehicle make(s), e.g. \"Ford\", \"Volkswagen\", \"BMW\". Common aliases are recognized (\"vw\" → Volkswagen, \"mercedes\" → Mercedes-Benz). Each make also narrows the search to its OLX subcategory for faster, more precise results. Add several to search multiple makes in one run.",
            "items": {
              "type": "string"
            }
          },
          "model": {
            "title": "🚘 Model",
            "type": "array",
            "description": "Model(s) within the selected make(s), e.g. \"focus\", \"golf\", \"a4\". Free text — only narrows results when it matches OLX's own model value for that make. Leave empty to include every model.",
            "items": {
              "type": "string"
            }
          },
          "yearMin": {
            "title": "📅 Year From",
            "minimum": 1900,
            "maximum": 2030,
            "type": "integer",
            "description": "Minimum production year (inclusive)."
          },
          "yearMax": {
            "title": "📅 Year To",
            "minimum": 1900,
            "maximum": 2030,
            "type": "integer",
            "description": "Maximum production year (inclusive)."
          },
          "priceMin": {
            "title": "💰 Price From (PLN)",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Minimum asking price in PLN (inclusive)."
          },
          "priceMax": {
            "title": "💰 Price To (PLN)",
            "minimum": 0,
            "maximum": 10000000,
            "type": "integer",
            "description": "Maximum asking price in PLN (inclusive)."
          },
          "mileageMax": {
            "title": "🛣️ Max Mileage (km)",
            "minimum": 0,
            "maximum": 2000000,
            "type": "integer",
            "description": "Only listings with mileage at or below this value (kilometers)."
          },
          "enginePowerMin": {
            "title": "🐎 Engine Power From (hp)",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Minimum engine power in horsepower (inclusive)."
          },
          "enginePowerMax": {
            "title": "🐎 Engine Power To (hp)",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Maximum engine power in horsepower (inclusive)."
          },
          "fuelType": {
            "title": "⛽ Fuel Type",
            "type": "array",
            "description": "Filter by one or more fuel types.",
            "items": {
              "type": "string",
              "enum": [
                "petrol",
                "diesel",
                "electric",
                "plugin-hybrid",
                "lpg",
                "cng"
              ],
              "enumTitles": [
                "Petrol",
                "Diesel",
                "Electric",
                "Plug-in hybrid",
                "LPG",
                "CNG"
              ]
            }
          },
          "transmission": {
            "title": "⚙️ Transmission",
            "enum": [
              "manual",
              "automatic"
            ],
            "type": "string",
            "description": "Filter by transmission type."
          },
          "bodyType": {
            "title": "🚙 Body Type",
            "type": "array",
            "description": "Filter by one or more body types.",
            "items": {
              "type": "string",
              "enum": [
                "sedan",
                "estate-car",
                "hatchback",
                "coupe",
                "cabriolet",
                "suv",
                "off-road-vehicle",
                "mvp",
                "minibus",
                "pickup"
              ],
              "enumTitles": [
                "Sedan",
                "Estate car / Wagon",
                "Hatchback",
                "Coupe",
                "Cabriolet / Convertible",
                "SUV",
                "Off-road / 4x4",
                "MPV / Minivan",
                "Minibus",
                "Pickup"
              ]
            }
          },
          "color": {
            "title": "🎨 Color",
            "type": "array",
            "description": "Filter by one or more exterior colors.",
            "items": {
              "type": "string",
              "enum": [
                "bialy",
                "czarny",
                "szary",
                "srebrny",
                "niebieski",
                "czerwony",
                "zielony",
                "brazowy_bezowy",
                "zolty_zloty",
                "inny"
              ],
              "enumTitles": [
                "White",
                "Black",
                "Grey",
                "Silver",
                "Blue",
                "Red",
                "Green",
                "Brown / Beige",
                "Yellow / Gold",
                "Other"
              ]
            }
          },
          "condition": {
            "title": "✨ Condition",
            "enum": [
              "notdamaged",
              "damaged"
            ],
            "type": "string",
            "description": "Filter by accident/damage condition."
          },
          "countryOrigin": {
            "title": "🌐 Country of Origin",
            "enum": [
              "pl",
              "d",
              "f",
              "gb",
              "i",
              "usa",
              "nl",
              "b",
              "a",
              "cz",
              "sk",
              "s",
              "n",
              "dk",
              "fi",
              "est",
              "lv",
              "lt",
              "h",
              "hu",
              "hr",
              "si",
              "bg",
              "ro",
              "ru",
              "ua",
              "by",
              "ch",
              "jp",
              "cdn",
              "tr",
              "irl",
              "is",
              "li",
              "l",
              "mc",
              "gr",
              "others"
            ],
            "type": "string",
            "description": "Filter by the country the vehicle was originally registered/imported from."
          },
          "sellerType": {
            "title": "👤 Seller Type",
            "enum": [
              "private",
              "business"
            ],
            "type": "string",
            "description": "Filter by private sellers or business/dealer listings."
          },
          "rightHandDrive": {
            "title": "🚦 Right-Hand Drive",
            "type": "boolean",
            "description": "Set true to include only right-hand-drive (import) cars, false to include only left-hand-drive. Leave unset to include both."
          },
          "carUrls": {
            "title": "🔗 Listing URLs",
            "type": "array",
            "description": "Paste individual OLX car-listing URLs directly (e.g. https://www.olx.pl/d/oferta/...-CIDxxx-IDyyyyyy.html). Bypasses search entirely — each URL is fetched and tracked on its own, with a 30-day not-found cache in incremental mode.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "cityId": {
            "title": "📍 City ID (advanced)",
            "minimum": 0,
            "type": "integer",
            "description": "OLX numeric city ID (e.g. 17871 = Warszawa). Trump card — when set, cityName, lat/lon are ignored. Most users should leave this empty and use cityName instead."
          },
          "cityName": {
            "title": "🏙️ City Name",
            "type": "string",
            "description": "City name (e.g. \"Warszawa\", \"Kraków\"). Resolved to OLX city ID via the Polish city dictionary. Ignored if cityId is set."
          },
          "region": {
            "title": "🗺️ Region",
            "type": "string",
            "description": "Filter to a single Polish voivodeship (e.g. \"Mazowieckie\", \"Śląskie\", \"Małopolskie\"). Accepts the region name (diacritic-insensitive, e.g. \"slaskie\") or its numeric region ID. If you ALSO set a City, the two intersect: the city must lie inside the region or you'll get zero results."
          },
          "lat": {
            "title": "🌐 Latitude",
            "minimum": -90,
            "maximum": 90,
            "type": "number",
            "description": "GPS latitude. Pair with lon. Ignored if cityId or cityName is set. Resolved to nearest known OLX city by GPS-bbox or distance tiers (5/20/50km)."
          },
          "lon": {
            "title": "🌐 Longitude",
            "minimum": -180,
            "maximum": 180,
            "type": "number",
            "description": "GPS longitude. Pair with lat."
          },
          "radiusKm": {
            "title": "📏 Search Radius (km)",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Search radius in kilometers around the resolved city. 0–500. OLX-native unit. Mutually exclusive with radiusMiles."
          },
          "radiusMiles": {
            "title": "📏 Search Radius (miles)",
            "minimum": 0,
            "maximum": 310,
            "type": "integer",
            "description": "Search radius in miles. Converted to OLX km internally. Mutually exclusive with radiusKm."
          },
          "allowLowConfidence": {
            "title": "🔓 Allow Low-Confidence Resolutions",
            "type": "boolean",
            "description": "When true, accept fuzzy-match or GPS-within-50km city resolutions instead of failing. Default false (fail loudly to prevent silent wrong-city results).",
            "default": false
          },
          "compactKeepResolvedLocation": {
            "title": "🗺️ Keep resolvedLocation in Compact Mode",
            "type": "boolean",
            "description": "By default, compact mode omits resolvedLocation. Set true to keep it for audit even in compact output.",
            "default": false
          },
          "distance": {
            "title": "🎯 Distance — DEPRECATED (use radiusKm)",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Legacy distance field in km. Deprecated — use radiusKm instead. Kept for back-compat with existing runs."
          },
          "maxResults": {
            "title": "💯 Max Results",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum total items to emit. 0 = unlimited — emits every listing that matches your filters, which on a broad or whole-market search can be many thousands. Because you are billed per result, an unlimited run's cost scales with how many listings match — set a number here to cap how much a single run can cost.",
            "default": 50
          },
          "maxPages": {
            "title": "📄 Max Pages",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Cap pagination at this many SERP pages per task (0 = unlimited).",
            "default": 0
          },
          "includeKeywords": {
            "title": "✅ Include Keywords",
            "type": "object",
            "description": "Post-fetch filter: only emit listings whose title or description contains at least one of these keywords. Example: { \"keywords\": [\"bezwypadkowy\", \"serwisowany\"], \"matchTitle\": true, \"matchDescription\": true }."
          },
          "excludeKeywords": {
            "title": "❌ Exclude Keywords",
            "type": "object",
            "description": "Post-fetch filter: drop listings whose title or description contains any of these keywords. Same shape as includeKeywords."
          },
          "fromDate": {
            "title": "📅 From Date",
            "type": "string",
            "description": "ISO date (YYYY-MM-DD) — drop listings posted before this date."
          },
          "toDate": {
            "title": "📅 To Date",
            "type": "string",
            "description": "ISO date (YYYY-MM-DD) — drop listings posted after this date."
          },
          "maxAgeMinutes": {
            "title": "⏱️ Max Age (minutes)",
            "minimum": 0,
            "type": "integer",
            "description": "Drop listings older than N minutes (0 = no limit). Useful for tight monitoring loops.",
            "default": 0
          },
          "customFilters": {
            "title": "🔧 Custom Filters",
            "type": "array",
            "description": "Array of {field, op, value} rules applied to each output record. Operators: includes, notIncludes, equals, notEquals, gt, gte, lt, lte.",
            "default": []
          },
          "descriptionMaxLength": {
            "title": "✂️ Description Max Length",
            "minimum": 0,
            "type": "integer",
            "description": "Truncate description to N chars. 0 = no truncation.",
            "default": 0
          },
          "descriptionFormat": {
            "title": "📝 Description Format",
            "enum": [
              "all",
              "text",
              "html",
              "markdown"
            ],
            "type": "string",
            "description": "`all` keeps every variant (default). `text` / `html` / `markdown` keep only one.",
            "default": "all"
          },
          "compact": {
            "title": "📦 Compact Output",
            "type": "boolean",
            "description": "Emit only core fields (for AI-agent / MCP workflows).",
            "default": false
          },
          "excludeEmptyFields": {
            "title": "🧹 Exclude Empty Fields",
            "type": "boolean",
            "description": "Drop null / empty-string / empty-array fields from each record.",
            "default": false
          },
          "incrementalMode": {
            "title": "♻️ Incremental Mode",
            "type": "boolean",
            "description": "Track changes between runs. Compares prior state and emits only NEW / UPDATED / EXPIRED entries — and flags price drops on UPDATED listings.",
            "default": false
          },
          "stateKey": {
            "title": "🔑 State Key",
            "type": "string",
            "description": "Stable identifier for the tracked search universe. Auto-generated if empty."
          },
          "emitUnchanged": {
            "title": "♻️ Emit Unchanged",
            "type": "boolean",
            "description": "Also emit unchanged listings (incrementalMode only).",
            "default": false
          },
          "emitExpired": {
            "title": "⚰️ Emit Expired",
            "type": "boolean",
            "description": "Also emit expired listings (incrementalMode only).",
            "default": false
          },
          "skipReposts": {
            "title": "🚫 Skip Reposts",
            "type": "boolean",
            "description": "Skip listings whose content matches an expired listing from a prior run.",
            "default": false
          },
          "telegramToken": {
            "title": "🔑 Telegram Bot Token",
            "type": "string",
            "description": "Bot token from @BotFather."
          },
          "telegramChatId": {
            "title": "💬 Telegram Chat ID",
            "type": "string",
            "description": "Chat or channel ID."
          },
          "discordWebhookUrl": {
            "title": "🎮 Discord Webhook URL",
            "type": "string",
            "description": "Discord incoming webhook URL."
          },
          "slackWebhookUrl": {
            "title": "💼 Slack Webhook URL",
            "type": "string",
            "description": "Slack incoming webhook URL."
          },
          "whatsappAccessToken": {
            "title": "📱 WhatsApp Access Token",
            "type": "string",
            "description": "WhatsApp Cloud API token."
          },
          "whatsappPhoneNumberId": {
            "title": "📞 WhatsApp Phone Number ID",
            "type": "string",
            "description": "Your WhatsApp Business phone-number ID."
          },
          "whatsappTo": {
            "title": "📲 WhatsApp Recipient",
            "type": "string",
            "description": "Recipient phone in E.164 without +."
          },
          "webhookUrl": {
            "title": "🪝 Generic Webhook URL",
            "type": "string",
            "description": "Receives JSON POST with {metadata, items} after each run."
          },
          "webhookHeaders": {
            "title": "📋 Webhook Headers",
            "type": "object",
            "description": "Custom headers, e.g. {\"Authorization\":\"Bearer ...\"}."
          },
          "notificationLimit": {
            "title": "📊 Max Listings Per Notification",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum listings per notification message.",
            "default": 5
          },
          "notifyOnlyChanges": {
            "title": "🔄 Notify Only New/Updated",
            "type": "boolean",
            "description": "In incremental mode, only notify for NEW + UPDATED.",
            "default": false
          },
          "includeRunMetadata": {
            "title": "🧾 Include Run Metadata",
            "type": "boolean",
            "description": "Add matchedStartUrls provenance to each record (when startUrls mode).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}