{
  "openapi": "3.0.1",
  "info": {
    "title": "OTOMOTO Price & Stock Monitor",
    "description": "Monitor OTOMOTO searches and export only real changes: price drops, sold or delisted cars, and cars that come back. Every row includes make, model, year, mileage, fuel and city. Pay per page fetched and per detected change.",
    "version": "0.2",
    "x-build-id": "kmeS4acBx7MwUDTUj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/blond_triathlon~otomoto-price-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-blond_triathlon-otomoto-price-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/blond_triathlon~otomoto-price-monitor/runs": {
      "post": {
        "operationId": "runs-sync-blond_triathlon-otomoto-price-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/blond_triathlon~otomoto-price-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-blond_triathlon-otomoto-price-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",
        "properties": {
          "startUrls": {
            "title": "OTOMOTO search URLs",
            "type": "array",
            "description": "Paste one or more OTOMOTO search-result URLs (a page starting with /osobowe, /motocykle, /dostawcze...). A dealer's own page also works: paste its OTOMOTO address (e.g. https://wincars.otomoto.pl) and the Actor reads that dealer's whole stock. Set the filters on otomoto.pl, copy the address bar, and paste it here. Each URL is one independent watchlist. A single /oferta/... URL is also accepted and tracks that one car.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "filters": {
            "title": "Build a search from filters (optional)",
            "type": "object",
            "description": "Alternative to startUrls. Builds exactly one OTOMOTO search from the fields below. Use startUrls if you need city-level or equipment filters, which are easiest to set on the site itself.",
            "properties": {
              "label": {
                "type": "string",
                "title": "Watchlist label",
                "description": "Human-readable name stored in every row, e.g. 'BMW diesel automatic under 60k'.",
                "editor": "textfield"
              },
              "category": {
                "type": "string",
                "title": "Vehicle category",
                "description": "Main OTOMOTO category to search in.",
                "editor": "select",
                "enum": [
                  "osobowe",
                  "motocykle",
                  "dostawcze",
                  "ciezarowe",
                  "przyczepy",
                  "maszyny"
                ],
                "enumTitles": [
                  "Cars",
                  "Motorcycles",
                  "Vans",
                  "Trucks",
                  "Trailers",
                  "Machinery"
                ],
                "default": "osobowe"
              },
              "make": {
                "type": "string",
                "title": "Make",
                "description": "Brand slug as used by OTOMOTO, e.g. bmw, audi, toyota. Leave empty for all brands.",
                "editor": "textfield"
              },
              "model": {
                "type": "string",
                "title": "Model",
                "description": "Model slug, e.g. seria-5, a4, corolla. Requires a make.",
                "editor": "textfield"
              },
              "priceMin": {
                "type": "integer",
                "title": "Min price (PLN)",
                "description": "Lower bound of the asking price, in złoty.",
                "editor": "number"
              },
              "priceMax": {
                "type": "integer",
                "title": "Max price (PLN)",
                "description": "Upper bound of the asking price, in złoty.",
                "editor": "number"
              },
              "yearMin": {
                "type": "integer",
                "title": "Min production year",
                "description": "Only include cars produced in this year or later.",
                "editor": "number"
              },
              "yearMax": {
                "type": "integer",
                "title": "Max production year",
                "description": "Only include cars produced in this year or earlier.",
                "editor": "number"
              },
              "mileageMax": {
                "type": "integer",
                "title": "Max mileage (km)",
                "description": "Only include cars with this mileage or lower.",
                "editor": "number"
              },
              "fuelType": {
                "type": "string",
                "title": "Fuel type",
                "description": "Filter by fuel. Leave empty for all fuels.",
                "editor": "select",
                "enum": [
                  "petrol",
                  "diesel",
                  "hybrid",
                  "electric",
                  "lpg"
                ],
                "enumTitles": [
                  "Petrol",
                  "Diesel",
                  "Hybrid",
                  "Electric",
                  "LPG"
                ]
              },
              "gearbox": {
                "type": "string",
                "title": "Gearbox",
                "description": "Filter by gearbox. Leave empty for all.",
                "editor": "select",
                "enum": [
                  "manual",
                  "automatic"
                ],
                "enumTitles": [
                  "Manual",
                  "Automatic"
                ]
              },
              "order": {
                "type": "string",
                "title": "Sort order",
                "description": "Result ordering. Newest first is the best choice for change detection.",
                "editor": "select",
                "enum": [
                  "created_at_first:desc",
                  "created_at_first:asc",
                  "filter_float_price:asc",
                  "filter_float_price:desc",
                  "relevance_web"
                ],
                "enumTitles": [
                  "Newest first",
                  "Oldest first",
                  "Cheapest first",
                  "Most expensive first",
                  "Relevance"
                ],
                "default": "created_at_first:desc"
              }
            }
          },
          "maxPagesPerSearch": {
            "title": "Pages per search",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "How many result pages to fetch per search. Each page is one request and holds up to 32 cars. Keep at 1 to stay inside the free tier.",
            "default": 1
          },
          "maxOffersPerSearch": {
            "title": "Max cars per search",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Cap on listings kept per search. Listings beyond this are ignored.",
            "default": 32
          },
          "mode": {
            "title": "Output mode",
            "enum": [
              "changes",
              "snapshot"
            ],
            "type": "string",
            "description": "changes = emit only price/availability changes (recommended for scheduled monitoring). snapshot = emit every car seen.",
            "default": "changes"
          },
          "stateKey": {
            "title": "History namespace",
            "type": "string",
            "description": "Key-value store record that holds the previous run's prices. Use the same value on every run of a given watchlist; use different values for independent watchlists.",
            "default": "otomoto-watchlist-1"
          },
          "removedAfterRuns": {
            "title": "Report delisting after N misses",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "How many consecutive runs a car must be missing before it is reported as delisted. 2 avoids false alarms when results shift between pages.",
            "default": 2
          },
          "proxyMode": {
            "title": "Proxy mode",
            "enum": [
              "auto",
              "unblocker",
              "residential",
              "none"
            ],
            "type": "string",
            "description": "OTOMOTO serves normal datacenter IPs, so 'auto' is free and sufficient. 'unblocker' costs ~$1.5 per 1,000 requests and is only needed if your runs start getting 403s.",
            "default": "auto"
          },
          "proxyUrl": {
            "title": "Custom proxy URL",
            "type": "string",
            "description": "Optional. Overrides proxyMode entirely, e.g. http://user:pass@host:port. Leave empty to use Apify Proxy."
          },
          "maxRequests": {
            "title": "Max requests",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "Hard cap on outbound requests in this run. This is your cost guard.",
            "default": 40
          },
          "requestDelayMs": {
            "title": "Delay between requests (ms)",
            "minimum": 0,
            "maximum": 30000,
            "type": "integer",
            "description": "Politeness delay. 800-2000 ms is recommended.",
            "default": 1200
          },
          "maxRetries": {
            "title": "Retries per URL",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries on 403/429/5xx. Each retry is a request.",
            "default": 2
          },
          "alertOn": {
            "title": "Emit changes of type",
            "type": "array",
            "description": "Which change types are written to the dataset.",
            "items": {
              "type": "string"
            },
            "default": [
              "new_offer",
              "price_down",
              "price_up",
              "back_in_stock",
              "out_of_stock",
              "removed"
            ]
          },
          "minPriceChangePct": {
            "title": "Ignore changes below (%)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Price moves smaller than this percentage are ignored. Filters noise from rounding.",
            "default": 0.5
          },
          "debugHtml": {
            "title": "Save raw page for debugging",
            "type": "boolean",
            "description": "Store the first fetched search page in the run's key-value store so the parser can be inspected. Turn off in production.",
            "default": false
          },
          "telegram": {
            "title": "Telegram alerts",
            "type": "object",
            "description": "Optional free alerting. Create a bot with @BotFather, then send it a message and read the chat id from getUpdates.",
            "properties": {
              "botToken": {
                "type": "string",
                "title": "Bot token",
                "description": "Token from @BotFather, e.g. 123456:ABC-DEF.",
                "editor": "textfield"
              },
              "chatId": {
                "type": "string",
                "title": "Chat ID",
                "description": "Numeric chat id that receives the alerts.",
                "editor": "textfield"
              },
              "onlyTypes": {
                "type": "array",
                "title": "Alert only on",
                "description": "Change types that are sent to Telegram.",
                "editor": "stringList",
                "default": [
                  "price_down",
                  "back_in_stock",
                  "new_offer"
                ],
                "items": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}