{
  "openapi": "3.0.1",
  "info": {
    "title": "Aqar Scraper — Saudi Arabia Property Data & API",
    "description": "Aqar scraper & real estate data API for Saudi Arabia's #1 property portal (sa.aqar.fm). Sale & rent listings across every Saudi city: price, price/m², beds, baths, area, GPS, photos, advertiser, FAL license & deed number — clean JSON/CSV.",
    "version": "1.0",
    "x-build-id": "DufgYKuG4ADcOwn47"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sian.agency~aqar-property-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sian.agency-aqar-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~aqar-property-scraper/runs": {
      "post": {
        "operationId": "runs-sync-sian.agency-aqar-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~aqar-property-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-sian.agency-aqar-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": "⚡ **OVERVIEW** — fast, cheap, ungated. Pulls every core field straight from Aqar's search (price, price/m², beds, baths, area, GPS, photos, advertiser, FAL license, deed).\n\n🔍 **DETAIL** — full record per listing by listing ID. Priced higher per result.\n\n**TIP:** Start with Overview — the search record already carries ~95% of useful fields.",
            "default": "overview"
          },
          "searchMode": {
            "title": "🧭 Search by (auto-detected)",
            "enum": [
              "bySearch",
              "byListingId"
            ],
            "type": "string",
            "description": "🧭 How to tell the scraper what to fetch. **Usually leave this blank — it is auto-inferred** from your inputs:\n\n- **By search** — search a property category + city + filters. The default.\n- **By listing ID** — Detail mode only: fetch specific listings by their Aqar listing ID.\n\n**NOTE:** *By listing ID* is valid only when Scrape mode = Detail.",
            "default": "bySearch"
          },
          "category": {
            "title": "🏷️ Category (property type + deal)",
            "enum": [
              "",
              "1",
              "6",
              "3",
              "5",
              "2",
              "15",
              "9",
              "11",
              "7",
              "16",
              "14",
              "47",
              "8",
              "20",
              "12",
              "56",
              "23",
              "19",
              "4",
              "22"
            ],
            "type": "string",
            "description": "🏷️ Aqar's combined category — it bundles the **property type and the deal (sale/rent)** into one ID. Either set this directly, OR leave it blank and use **Property type** + **Deal** below.\n\nCommon IDs: **1** = Apartment for rent · **6** = Apartment for sale · **3** = Villa for sale · **5** = Villa for rent · **2** = Land for sale · **9** = House for sale · **14** = Office for rent.",
            "default": "6"
          },
          "propertyType": {
            "title": "🏠 Property type",
            "enum": [
              "",
              "apartment",
              "villa",
              "land",
              "house",
              "building",
              "office",
              "store",
              "farm",
              "chalet",
              "room",
              "floor",
              "warehouse",
              "rest_house",
              "camp"
            ],
            "type": "string",
            "description": "🏠 Optional alias — used only when **Category** is blank. Combined with **Deal** to resolve the right category.",
            "default": ""
          },
          "deal": {
            "title": "🤝 Deal",
            "enum": [
              "",
              "sale",
              "rent"
            ],
            "type": "string",
            "description": "🤝 Optional alias — used only when **Category** is blank. Combined with **Property type** to resolve the right category.",
            "default": ""
          },
          "city": {
            "title": "🏙️ City",
            "type": "string",
            "description": "🏙️ City to search — Arabic or English (e.g. `Riyadh`, `الرياض`, `Jeddah`, `Dammam`). Resolved to the highest-inventory match automatically. Leave blank to search all of Saudi Arabia."
          },
          "cityId": {
            "title": "🆔 City ID",
            "minimum": 1,
            "type": "integer",
            "description": "🆔 Optional. Aqar numeric city ID (overrides **City** when set). E.g. 21 = Riyadh, 66 = Jeddah."
          },
          "listingIds": {
            "title": "🆔 Listing IDs",
            "type": "array",
            "description": "🆔 **Detail mode only.** Specific Aqar listing IDs (or full `https://sa.aqar.fm/listing/<id>` URLs) to fetch as full records.\n\n**BULK EDIT:** Click \"Bulk edit\" to paste many IDs, one per line.",
            "items": {
              "type": "string"
            }
          },
          "maxResults": {
            "title": "🔢 Max results",
            "minimum": 1,
            "type": "integer",
            "description": "🔢 Maximum listings to extract this run.\n\n- **FREE tier:** capped at 25 listings per run.\n- **PAID tier:** unlimited — set as high as you need.",
            "default": 100
          },
          "sort": {
            "title": "↕️ Sort by",
            "enum": [
              "create_time",
              "last_update",
              "price",
              "area",
              "meter_price",
              "refresh"
            ],
            "type": "string",
            "description": "↕️ How Aqar orders the results before they are scraped.",
            "default": "create_time"
          },
          "sortDir": {
            "title": "↕️ Sort direction",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "↕️ Ascending or descending order for the sort field above.",
            "default": "desc"
          },
          "minPrice": {
            "title": "💸 Min price (SAR)",
            "minimum": 0,
            "type": "integer",
            "description": "💸 Optional. Minimum price filter in Saudi Riyal."
          },
          "maxPrice": {
            "title": "💰 Max price (SAR)",
            "minimum": 0,
            "type": "integer",
            "description": "💰 Optional. Maximum price filter in Saudi Riyal."
          },
          "minArea": {
            "title": "📐 Min area (m²)",
            "minimum": 0,
            "type": "integer",
            "description": "📐 Optional. Minimum area in square meters."
          },
          "maxArea": {
            "title": "📐 Max area (m²)",
            "minimum": 0,
            "type": "integer",
            "description": "📐 Optional. Maximum area in square meters."
          },
          "minBeds": {
            "title": "🛏️ Min bedrooms",
            "minimum": 0,
            "type": "integer",
            "description": "🛏️ Optional. Minimum number of bedrooms."
          },
          "minLivings": {
            "title": "🛋️ Min living rooms",
            "minimum": 0,
            "type": "integer",
            "description": "🛋️ Optional. Minimum number of living rooms."
          },
          "minBaths": {
            "title": "🛁 Min bathrooms",
            "minimum": 0,
            "type": "integer",
            "description": "🛁 Optional. Minimum number of bathrooms."
          },
          "furnished": {
            "title": "🛋️ Furnishing",
            "enum": [
              "",
              "1",
              "0"
            ],
            "type": "string",
            "description": "🛋️ Optional. Filter by furnishing status.",
            "default": ""
          },
          "districtId": {
            "title": "📍 District ID",
            "minimum": 1,
            "type": "integer",
            "description": "📍 Optional. Restrict to a specific Aqar district ID within the city."
          },
          "directionId": {
            "title": "🧭 Direction ID",
            "minimum": 1,
            "type": "integer",
            "description": "🧭 Optional. Restrict to a specific Aqar street-direction ID (facing)."
          },
          "provinceId": {
            "title": "🗺️ Province ID",
            "minimum": 1,
            "type": "integer",
            "description": "🗺️ Optional. Restrict to a specific Aqar province ID."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}