{
  "openapi": "3.0.1",
  "info": {
    "title": "Fazwaz Thailand Property Scraper — Sale & Rent",
    "description": "Scrape Thai real-estate listings from FazWaz — sale & rent across Phuket, Bangkok & all Thailand, as clean JSON/CSV. Choose a fast overview scan or full detail (photos, GPS, ownership, rental yield, price-per-sqm). Search by region, search URL, or specific listing URLs.",
    "version": "1.0",
    "x-build-id": "tAJeacgqczsfDCcn0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sian.agency~fazwaz-property-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sian.agency-fazwaz-property-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/sian.agency~fazwaz-property-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sian.agency-fazwaz-property-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/sian.agency~fazwaz-property-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sian.agency-fazwaz-property-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": {
          "scrapeMode": {
            "title": "🧭 Scrape mode",
            "enum": [
              "overview",
              "detail"
            ],
            "type": "string",
            "description": "How deep to scrape each listing.\n\n- **Overview** = fast price/spec scan straight from search-result cards (no detail-page visits, ~30 listings per fetch). Best for sizing a market cheaply.\n- **Detail** = everything Overview returns PLUS the full per-listing record (description, photos, GPS coordinates, ownership, furnishing, developer, completion, amenities…) — a strict superset.",
            "default": "overview"
          },
          "searchMode": {
            "title": "🔎 Search mode",
            "enum": [
              "byRegion",
              "bySearchUrl",
              "byListingUrl"
            ],
            "type": "string",
            "description": "How to choose which listings to scrape. Fill in the matching section below.\n\n- **By region** — pick provinces + sale/rent (the default).\n- **By search URL** — paste a FazWaz search-results URL.\n- **By listing URL** — paste specific listing URLs (Detail mode only).",
            "default": "byRegion"
          },
          "maxResults": {
            "title": "🔢 Max results",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum listings to return this run. The free tier is capped at 25.",
            "default": 100
          },
          "provinces": {
            "title": "📍 Provinces",
            "type": "array",
            "description": "Thai provinces to scrape when Search mode = **By region** (e.g. phuket, bangkok, chiang-mai, pattaya, koh-samui, hua-hin). Add as many as you like.",
            "default": [
              "phuket",
              "bangkok"
            ],
            "items": {
              "type": "string"
            }
          },
          "operation": {
            "title": "🏠 Sale or rent",
            "enum": [
              "sale",
              "rent"
            ],
            "type": "string",
            "description": "Which side of the market to scrape (used with By region).",
            "default": "sale"
          },
          "searchUrl": {
            "title": "🔗 Search URL",
            "type": "string",
            "description": "Paste a single FazWaz **search-results** URL (used when Search mode = By search URL). Any filters baked into the URL are kept; pagination is automatic. For several URLs at once, use **Search URLs** below instead.\n\n**Example:** `https://www.fazwaz.com/property-for-sale/thailand/phuket`"
          },
          "searchUrls": {
            "title": "🔗 Search URLs (multiple)",
            "type": "array",
            "description": "Paste one or more FazWaz **search-results** URLs (used when Search mode = By search URL). Each URL is paged through and the results are merged with duplicates removed — e.g. combine Phuket sale + Bangkok rent + a typed villa search in a single run. **Max results is spread evenly across all the URLs**, so each contributes its share. Filters baked into each URL are kept. You can mix this with the single Search URL above.",
            "items": {
              "type": "string"
            }
          },
          "listingUrls": {
            "title": "🏷️ Listing URLs",
            "type": "array",
            "description": "Specific FazWaz **listing** URLs to scrape (used when Search mode = By listing URL; **Detail mode only**). Add one URL per line.\n\n**Example:** `https://www.fazwaz.com/property-sales/2-bedroom-condo-for-sale-at-supalai-city-resort-phuket-in-ratsada-phuket-u5350611`",
            "items": {
              "type": "string"
            }
          },
          "sortBy": {
            "title": "↕️ Sort by",
            "enum": [
              "recommended",
              "newest",
              "price_asc",
              "price_desc"
            ],
            "type": "string",
            "description": "Result order. Applies to **By region** and **By search URL**. Recommended = FazWaz default ranking.",
            "default": "recommended"
          },
          "propertyTypes": {
            "title": "🏘️ Property types",
            "uniqueItems": true,
            "type": "array",
            "description": "Filter by property type (By region only). Leave empty for all types.",
            "items": {
              "type": "string",
              "enum": [
                "condo",
                "villa",
                "house",
                "townhouse",
                "apartment",
                "penthouse",
                "land"
              ],
              "enumTitles": [
                "Condo",
                "Villa",
                "House",
                "Townhouse",
                "Apartment",
                "Penthouse",
                "Land"
              ]
            }
          },
          "minPrice": {
            "title": "💰 Min price (THB)",
            "minimum": 0,
            "type": "integer",
            "description": "Minimum price in Thai Baht (By region only). Leave empty for no minimum."
          },
          "maxPrice": {
            "title": "💰 Max price (THB)",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum price in Thai Baht (By region only). Leave empty for no maximum."
          },
          "bedrooms": {
            "title": "🛏️ Bedrooms",
            "uniqueItems": true,
            "type": "array",
            "description": "Bedroom counts to include (By region only). Pick any combination; leave empty for any.",
            "items": {
              "type": "string",
              "enum": [
                "0",
                "1",
                "2",
                "3",
                "4"
              ],
              "enumTitles": [
                "Studio (0)",
                "1",
                "2",
                "3",
                "4+"
              ]
            }
          },
          "bathrooms": {
            "title": "🛁 Bathrooms",
            "uniqueItems": true,
            "type": "array",
            "description": "Bathroom counts to include (By region only). Pick any combination; leave empty for any.",
            "items": {
              "type": "string",
              "enum": [
                "1",
                "2",
                "3",
                "4"
              ],
              "enumTitles": [
                "1",
                "2",
                "3",
                "4+"
              ]
            }
          },
          "completionStatus": {
            "title": "🏗️ Completion status",
            "enum": [
              "all",
              "off_plan",
              "completed"
            ],
            "type": "string",
            "description": "Build status filter (By region only). All = both off-plan and completed.",
            "default": "all"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}