{
  "openapi": "3.0.1",
  "info": {
    "title": "Thailand Used Car Market Scraper",
    "description": "Scrapes and normalizes used car listings from One2car, Carsome Thailand, Taladrod, and Kaidee Auto.",
    "version": "0.1",
    "x-build-id": "CoYCTKvOZr2GimcgQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mai_amm~thai-used-car-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mai_amm-thai-used-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/mai_amm~thai-used-car-scraper/runs": {
      "post": {
        "operationId": "runs-sync-mai_amm-thai-used-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/mai_amm~thai-used-car-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-mai_amm-thai-used-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": {
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "Used car websites to scrape.",
            "items": {
              "type": "string",
              "enum": [
                "one2car",
                "carsome",
                "taladrod",
                "kaidee"
              ],
              "enumTitles": [
                "One2car",
                "Carsome Thailand",
                "Taladrod",
                "Kaidee Auto"
              ]
            },
            "default": [
              "carsome",
              "taladrod",
              "kaidee"
            ]
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Keyword such as toyota, honda, fortuner, civic, รถบ้าน."
          },
          "startUrls": {
            "title": "Start URLs",
            "type": "array",
            "description": "Optional listing URLs from supported websites. If provided, these are crawled in addition to generated search URLs.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of saved listings across all selected sources.",
            "default": 100
          },
          "maxPagesPerSource": {
            "title": "Max pages per source",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum listing pages to crawl for each generated source search.",
            "default": 3
          },
          "includeOne2car": {
            "title": "Include One2car",
            "type": "boolean",
            "description": "One2car is protected by Cloudflare. Enable this only when you want to scrape One2car in addition to HTTP-friendly sources.",
            "default": false
          },
          "useOne2carUnblocker": {
            "title": "Use One2car unblocker",
            "type": "boolean",
            "description": "Legacy switch. When enabled, One2car strategy is treated as Unblocker.",
            "default": false
          },
          "one2carStrategy": {
            "title": "One2car strategy",
            "enum": [
              "camoufox",
              "auto",
              "unblocker",
              "playwright-extra"
            ],
            "type": "string",
            "description": "Primary One2car scraping strategy. Auto tries direct Camoufox first and falls back to the unblocker only if no items are saved.",
            "default": "camoufox"
          },
          "one2carDirectMode": {
            "title": "One2car direct mode",
            "enum": [
              "browser-session",
              "manual-browser",
              "basic-browser"
            ],
            "type": "string",
            "description": "Direct One2car browser strategy used when Use One2car unblocker is disabled. Browser session mode warms up the domain and reuses cookies/session.",
            "default": "browser-session"
          },
          "one2carChallengeWaitSecs": {
            "title": "One2car challenge wait seconds",
            "minimum": 0,
            "maximum": 180,
            "type": "integer",
            "description": "Maximum time to wait for a direct One2car browser session to pass a challenge page.",
            "default": 30
          },
          "one2carWarmupWaitSecs": {
            "title": "One2car warmup wait seconds",
            "minimum": 0,
            "maximum": 60,
            "type": "integer",
            "description": "Short warmup wait before opening the actual One2car listing page. Keep this lower than challenge wait for faster direct runs.",
            "default": 4
          },
          "one2carNavigationTimeoutSecs": {
            "title": "One2car navigation timeout seconds",
            "minimum": 15,
            "maximum": 180,
            "type": "integer",
            "description": "Maximum navigation time for each direct One2car page attempt. Lower values fail and rotate sessions faster.",
            "default": 60
          },
          "one2carBrowserEngine": {
            "title": "One2car browser engine",
            "enum": [
              "camoufox",
              "playwright-extra"
            ],
            "type": "string",
            "description": "Browser engine used by Auto direct mode. Camoufox follows Apify's Crawlee + Playwright + Camoufox template and is the default anti-bot option.",
            "default": "camoufox"
          },
          "one2carBlockAssets": {
            "title": "Block One2car heavy assets",
            "type": "boolean",
            "description": "Block images, fonts, and media in direct One2car browser mode to reduce load time and bandwidth.",
            "default": true
          },
          "one2carUseSessionStore": {
            "title": "Use One2car session store",
            "type": "boolean",
            "description": "Persist One2car Crawlee sessions and cookies in a named key-value store so proxy session, browser fingerprint, and cookies can be reused across runs.",
            "default": true
          },
          "one2carDirectAttempts": {
            "title": "One2car direct attempts",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Maximum direct browser sessions to try for each One2car page before giving up.",
            "default": 3
          },
          "one2carUnblockerActor": {
            "title": "One2car unblocker Actor",
            "type": "string",
            "description": "Apify Actor name used when Use One2car unblocker is enabled. Expected output: dataset item with an html field.",
            "default": "scrapeunblocker/scrapeunblocker"
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Apify proxy configuration for direct HTTP/browser crawls. Residential Thai proxies may help, but One2car currently works best through the optional unblocker mode.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}