{
  "openapi": "3.0.1",
  "info": {
    "title": "Nettikone Scraper — Used Machinery Finland",
    "description": "Scrape Nettikone used machinery listings in Finland: excavators, tractors, forestry, trucks, and dealer stock. Extract EUR prices, hours, VAT, specs, and images — a Nettikone scraper / API alternative.",
    "version": "0.1",
    "x-build-id": "pZOIIjeItjkULiefq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawloop~nettikone-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawloop-nettikone-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/crawloop~nettikone-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawloop-nettikone-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/crawloop~nettikone-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawloop-nettikone-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": {
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Nettikone category, search (/haku), listing detail (/{make}/{model}/{id}), or dealer profile (/yritys/{id}) URLs. Finnish slugs stay in the path even on /en/. Example: /en/maarakennus/kaivinkone or /en/haku?q=volvo. Do not use listDealer.php — it is loaded by region in JavaScript; pass /yritys/{id} or /haku?id_user= instead.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Optional keyword search. Builds /haku?q=… and appends it to start URLs (e.g. Volvo EC)."
          },
          "make": {
            "title": "Make / brand",
            "type": "string",
            "description": "Optional brand keyword merged into the search query (e.g. Hitachi, Volvo, John Deere)."
          },
          "machineTypes": {
            "title": "Machine type shortcuts",
            "type": "array",
            "description": "Built-in category roots when you do not want to paste URLs. Finnish path slugs are used on both FI and EN.",
            "items": {
              "type": "string",
              "enum": [
                "agriculture",
                "construction",
                "forestry",
                "garage",
                "groundscare",
                "halls",
                "lifters",
                "material-handling",
                "processing",
                "tanks",
                "transfer-tables",
                "transport",
                "excavators",
                "tractors",
                "trucks",
                "harvesters",
                "forklifts",
                "loaders"
              ],
              "enumTitles": [
                "Agriculture (maatalouskoneet)",
                "Construction (maarakennus)",
                "Forestry (metsakoneet)",
                "Garage equipment (korjaamolaitteet)",
                "Grounds care (ymparistokoneet)",
                "Halls & shelters (hallit-ja-katokset)",
                "Cranes / lifters (nosturit)",
                "Material handling (materiaalinkasittely)",
                "Processing machines (tyokoneet)",
                "Tanks & containers (kontit-ja-sailiot)",
                "Transfer tables (vaihtolavat)",
                "Transport (kuljetuskalusto)",
                "Excavators (kaivinkone)",
                "Tractors (traktorit)",
                "Trucks (kuorma-autot)",
                "Harvesters (harvesterit)",
                "Forklifts (trukit)",
                "Loaders (kuormaajat)"
              ]
            },
            "default": []
          },
          "language": {
            "title": "Language",
            "enum": [
              "en",
              "fi"
            ],
            "type": "string",
            "description": "UI language for built URLs. en uses /en/ prefix; fi uses the Finnish root. Category slugs stay Finnish in both cases.",
            "default": "en"
          },
          "adType": {
            "title": "Ad type",
            "enum": [
              "all",
              "for_sale",
              "for_rent",
              "sold"
            ],
            "type": "string",
            "description": "Filter for-sale, for-rent, or sold ads when building /haku or category URLs. all = no filter.",
            "default": "all"
          },
          "runMode": {
            "title": "Run Mode",
            "enum": [
              "listings",
              "details",
              "dealers"
            ],
            "type": "string",
            "description": "listings = fast card-level data from category/search pages. details = visit each listing for specs, VAT, images, seller. dealers = dealer profile rows from /yritys/{id} URLs. Default listings so Store QA finishes quickly.",
            "default": "listings"
          },
          "includePhones": {
            "title": "Include phone numbers",
            "type": "boolean",
            "description": "When true and runMode is details, decode seller phones from listing HTML (data-mobile / data-phone, often base64). Off by default (GDPR). You are responsible for lawful processing. The Actor does not fire the site's phone-click counter.",
            "default": false
          },
          "includeDealerProfiles": {
            "title": "Include dealer profiles",
            "type": "boolean",
            "description": "When a /yritys/{id} start URL is provided, also push a dealer profile row (name, address, inventory count).",
            "default": true
          },
          "maxItems": {
            "title": "Max Items",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum records to return (listings + dealers). 0 = unlimited. Keep small for Store auto-tests (under 5 minutes).",
            "default": 10
          },
          "maxPagesPerUrl": {
            "title": "Max Pages per Start URL",
            "minimum": 0,
            "type": "integer",
            "description": "Pagination depth per category/search/dealer URL (?page=N). 0 = until exhausted.",
            "default": 1
          },
          "concurrencyLimit": {
            "title": "Max Concurrency",
            "minimum": 1,
            "maximum": 12,
            "type": "integer",
            "description": "Parallel detail-page workers (1–12). Keep low (2–4) with Finnish residential proxies.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify Proxy. RESIDENTIAL in Finland (FI) is required for stable runs.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ],
              "apifyProxyCountry": "FI"
            }
          },
          "monitorMode": {
            "title": "Monitoring Mode",
            "type": "boolean",
            "description": "Delta tracking for category, search, or dealer inventory URLs. First run seeds a named Key-Value store (no dataset rows / alerts). Later runs output only new listings and price changes. Pair with an Apify Schedule.",
            "default": false
          },
          "monitorStoreName": {
            "title": "Monitor Store Name",
            "type": "string",
            "description": "Named Key-Value store for fingerprints across scheduled runs. Use a distinct name per watch target (e.g. excavators vs a dealer).",
            "default": "nettikone-monitor-state"
          },
          "telegramToken": {
            "title": "Telegram Bot Token",
            "type": "string",
            "description": "Bot token for real-time alerts on new listings and price changes (monitorMode only). Create a bot via @BotFather."
          },
          "telegramChatId": {
            "title": "Telegram Chat ID",
            "type": "string",
            "description": "Telegram user or group chat ID that receives monitor alerts."
          },
          "resetMonitorState": {
            "title": "Reset Monitor State",
            "type": "boolean",
            "description": "Clear stored listing fingerprints before this run (forces a fresh seed run).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}