{
  "openapi": "3.0.1",
  "info": {
    "title": "Tori.fi Ads Scraper",
    "description": "Get structured data for public ads in Tori.fi search results, including IDs, titles, locations, seller types, trade labels, publication dates, images, and listing URLs. Search with keywords or use Tori.fi URLs to preserve filters; duplicate ads are removed across pages and searches.",
    "version": "1.0",
    "x-build-id": "mcJSJXw6YrPQtftWl"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/axiomworks~tori-fi-ads-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-axiomworks-tori-fi-ads-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/axiomworks~tori-fi-ads-scraper/runs": {
      "post": {
        "operationId": "runs-sync-axiomworks-tori-fi-ads-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/axiomworks~tori-fi-ads-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-axiomworks-tori-fi-ads-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": {
          "searchQueries": {
            "title": "Keyword searches, e.g. polkupyora",
            "type": "array",
            "description": "Search keywords as strings, e.g. [\"polkupyora\", \"sohva\"]. Supply searchQueries or startUrls; both are accepted together. URLs run first, then keywords. Empty searches return zero ads; try broader Finnish terms.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Search URL objects, e.g. q=iphone",
            "type": "array",
            "description": "Public HTTPS Tori.fi search URLs as objects, e.g. [{\"url\":\"https://www.tori.fi/recommerce/forsale/search?q=iphone\"}]. Use the /recommerce/forsale/search path, not an ad detail URL or ID. URL filters and starting page are retained. Supply this or searchQueries.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL",
                  "description": "Public Tori.fi search page URL."
                }
              }
            }
          },
          "sort": {
            "title": "Search order, e.g. PRICE_ASC",
            "enum": [
              "RELEVANCE",
              "PUBLISHED_DESC",
              "PRICE_ASC",
              "PRICE_DESC"
            ],
            "type": "string",
            "description": "Choose RELEVANCE, PUBLISHED_DESC (newest, default), PRICE_ASC (lowest price), or PRICE_DESC (highest price). Applies to searches without a sort URL parameter; an explicit URL sort takes priority.",
            "default": "PUBLISHED_DESC"
          },
          "minPrice": {
            "title": "Minimum EUR amount, e.g. 50",
            "minimum": 0,
            "type": "integer",
            "description": "Include only ads priced at least this EUR amount, e.g. 50. Omit or use null for no lower bound. Applied to every target after site filters; ads without prices are excluded when either price bound is set."
          },
          "maxPrice": {
            "title": "Maximum EUR amount, e.g. 500",
            "minimum": 0,
            "type": "integer",
            "description": "Include only ads priced at most this EUR amount, e.g. 500. Omit or use null for no upper bound. Applied to every target after site filters; narrow price bounds can return zero ads."
          },
          "postedAfter": {
            "title": "Posted on or after",
            "type": "string",
            "description": "Include ads posted on or after this UTC date, YYYY-MM-DD, e.g. 2026-10-01. Empty (default) disables the lower date bound. Uses postedAt from search data; excludes undated ads when enabled. Filtering may return fewer than maxItems.",
            "default": ""
          },
          "postedBefore": {
            "title": "Posted on or before",
            "type": "string",
            "description": "Include ads through the end of this UTC date, YYYY-MM-DD. Empty (default) disables the upper date bound. Combine with postedAfter for an inclusive calendar-date window. The site timestamp can reflect a refreshed listing.",
            "default": ""
          },
          "sellerType": {
            "title": "Seller type",
            "enum": [
              "all",
              "private",
              "business"
            ],
            "type": "string",
            "description": "Keep all sellers (default), only private sellers, or only business sellers. Uses the source private/retailer flags already reported in sellerType. Unknown seller types are excluded when selecting private or business; applies across every target.",
            "default": "all"
          },
          "maxItems": {
            "title": "Shared ad limit, e.g. 30",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Return at most this many unique ads across all URLs and keywords combined, 1-10000, default 50; e.g. 30. Fewer ads are returned when filters or public availability limit matches. This is not a per-search limit.",
            "default": 50
          },
          "proxyConfiguration": {
            "title": "Proxy settings, e.g. useApifyProxy",
            "type": "object",
            "description": "Network settings, e.g. {\"useApifyProxy\":true}. Default {\"useApifyProxy\":false} requests public pages directly. Enable Apify Proxy if targets are blocked; retries use fresh sessions. Unavailable targets return zero ads with advice to change the search or connection.",
            "default": {
              "useApifyProxy": false
            }
          },
          "maxJevCalls": {
            "title": "AI call cap, e.g. 0",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Cap TypeSafe AI category classification and missing-field fallback calls across the run, 0-500, default 500. Set 0 to disable AI calls. Requires a configured runtime AI key; without one category remains null. Source fields are extracted without AI.",
            "default": 500
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}