{
  "openapi": "3.0.1",
  "info": {
    "title": "Blocket Ads Scraper",
    "description": "Collect classified ads from Blocket’s general marketplace and return titles, prices, locations, seller type, images, publish times and ad URLs. Optional ad-page details include descriptions, category paths and condition. Uses Blocket’s JSON search endpoint without a browser.",
    "version": "0.1",
    "x-build-id": "5aey4RKIKt4iolZX0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/axiomworks~blocket-ads-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-axiomworks-blocket-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~blocket-ads-scraper/runs": {
      "post": {
        "operationId": "runs-sync-axiomworks-blocket-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~blocket-ads-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-axiomworks-blocket-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": {
          "queries": {
            "title": "Search keywords (e.g. cykel)",
            "type": "array",
            "description": "Keywords to search, e.g. cykel or soffa. Supply queries, startUrls or a category. With default options, returns search-list fields without detail text. maxItems is shared across all searches; a missing or blocked target returns no ads.",
            "items": {
              "type": "string"
            }
          },
          "startUrls": {
            "title": "Search URL objects (e.g. {\"url\":\"https://www.blocket.se/recommerce/forsale/search?q=cykel\"})",
            "type": "array",
            "description": "Blocket Torget search URLs as strings or URL objects. Alternative to queries; q, category, sort, price_from, price_to, location and published are read from each URL. URL filters override matching input options; absent filters use those options. maxItems is shared across targets. Item URLs are not detail targets.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "category": {
            "title": "Category ID (e.g. 0.91)",
            "type": "string",
            "description": "Optional Blocket category ID to restrict the search, e.g. '0.91' (top level), '1.91.3108' (sub category) or '2.91.3108.362'. Leave empty to search all categories.",
            "default": ""
          },
          "location": {
            "title": "Location ID",
            "type": "string",
            "description": "Restrict Torget searches to a Blocket location ID, e.g. 0.300001 for Stockholm county. Default empty searches all Sweden. A start URL location overrides this value; clear it if no ads match.",
            "default": ""
          },
          "publishedToday": {
            "title": "Published today",
            "type": "boolean",
            "description": "Return only ads Blocket marks as published today. Default false includes all dates. Uses the site’s published=1 filter, not a rolling 24-hour window. A start URL published parameter overrides this option.",
            "default": false
          },
          "sort": {
            "title": "Sort order (e.g. PUBLISHED_DESC)",
            "enum": [
              "RELEVANCE",
              "PRICE_ASC",
              "PRICE_DESC",
              "PUBLISHED_DESC"
            ],
            "type": "string",
            "description": "Result order: RELEVANCE (default), PRICE_ASC, PRICE_DESC or PUBLISHED_DESC (newest first).",
            "default": "RELEVANCE"
          },
          "minPrice": {
            "title": "Minimum SEK price (e.g. 500)",
            "minimum": 0,
            "type": "integer",
            "description": "Only ads priced at or above this amount in SEK, e.g. 500. Leave empty for no lower limit. Used for queries and URLs without price_from; should not exceed maxPrice."
          },
          "maxPrice": {
            "title": "Maximum SEK price (e.g. 2000)",
            "minimum": 0,
            "type": "integer",
            "description": "Only ads priced at or below this amount in SEK, e.g. 2000. Leave empty for no upper limit. Used for queries and URLs without price_to; should not be below minPrice."
          },
          "sellerType": {
            "title": "Seller filter (e.g. private)",
            "enum": [
              "any",
              "private",
              "business"
            ],
            "type": "string",
            "description": "Seller filter: any (default), private or business, e.g. private. Applied after fetching; restrictive filters may return fewer than maxItems. Widen to any if no ads match.",
            "default": "any"
          },
          "maxItems": {
            "title": "Shared ad limit (e.g. 20)",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Total ads to save across all keywords and URLs, 1-5000, default 50. Duplicate ads count once. Stops at this shared limit; Blocket shows about 50 pages per search.",
            "default": 50
          },
          "includeDetails": {
            "title": "Fetch detail pages (true or false)",
            "type": "boolean",
            "description": "Set true to fetch each saved ad page for description, fullDescription, category and condition; unavailable details stay null. False (default), e.g. false, returns search fields only. Adds a paced request per ad and increases runtime.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy settings (e.g. useApifyProxy: false)",
            "type": "object",
            "description": "Apify Proxy settings. No proxy is used by default; if direct requests get blocked the Actor automatically retries through Apify datacenter proxy.",
            "default": {
              "useApifyProxy": 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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}