{
  "openapi": "3.0.1",
  "info": {
    "title": "BuyRentKenya Property Scraper — Kenya Real Estate",
    "description": "Extract property listings from BuyRentKenya.com — Kenya's largest real-estate portal. Search houses, flats, land and commercial property for sale or rent by location. Clean JSON: title, price (KES), area, beds/baths, agent, images, posting date. Server-rendered pages, no login, no browser.",
    "version": "0.1",
    "x-build-id": "HbBYHi8UxcryLjvnD"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/nomad-agent~buyrentkenya-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-nomad-agent-buyrentkenya-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/nomad-agent~buyrentkenya-scraper/runs": {
      "post": {
        "operationId": "runs-sync-nomad-agent-buyrentkenya-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/nomad-agent~buyrentkenya-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-nomad-agent-buyrentkenya-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": {
          "searchType": {
            "title": "Buy or rent",
            "enum": [
              "buy",
              "rent"
            ],
            "type": "string",
            "description": "Search listings for sale ('buy') or for rent ('rent').",
            "default": "buy"
          },
          "propertyType": {
            "title": "Property type",
            "enum": [
              "all",
              "houses",
              "flats-apartments",
              "land",
              "commercial",
              "bedsitters"
            ],
            "type": "string",
            "description": "Which category to search. 'all' crawls every category available for the chosen searchType (bedsitters exist for rent only, land for sale only).",
            "default": "all"
          },
          "location": {
            "title": "Location",
            "type": "string",
            "description": "Location path slug as used on buyrentkenya.com URLs — e.g. 'nairobi', 'mombasa', 'kiambu', or a nested area like 'nairobi/westlands'. Leave empty for all of Kenya."
          },
          "minPrice": {
            "title": "Min price (KES)",
            "minimum": 0,
            "type": "integer",
            "description": "Drop listings priced below this (Kenyan shillings). 0 = no minimum. Filtering happens client-side; listings without a public price are dropped when a bound is set.",
            "default": 0
          },
          "maxPrice": {
            "title": "Max price (KES)",
            "minimum": 0,
            "type": "integer",
            "description": "Drop listings priced above this (Kenyan shillings). 0 = no maximum.",
            "default": 0
          },
          "minBedrooms": {
            "title": "Min bedrooms",
            "minimum": 0,
            "type": "integer",
            "description": "Drop listings with fewer bedrooms than this. Bedroom count comes free from the search-page listing card (no detail fetch needed), or from the detail page when 'Fetch listing details' is on. 0 = no minimum. Listings with an unknown bedroom count are dropped when this is set, same as the price filters. Only applies to search mode — not to explicit 'Listing URLs'.",
            "default": 0
          },
          "minBathrooms": {
            "title": "Min bathrooms",
            "minimum": 0,
            "type": "integer",
            "description": "Drop listings with fewer bathrooms than this. Bathroom count is only available from a listing's detail page, so setting this above 0 automatically enables 'Fetch listing details' even if you left it off (one extra request per listing — see Pricing). Listings with an unknown bathroom count are dropped when this is set. 0 = no minimum. Only applies to search mode — not to explicit 'Listing URLs'.",
            "default": 0
          },
          "maxPages": {
            "title": "Max pages per category",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Search-result pages to crawl per category (25 listings/page). Hard cap 10 — the site's robots.txt only allows pagination up to page 10.",
            "default": 3
          },
          "maxItems": {
            "title": "Max items (total)",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "Hard cap on total listings returned. 0 = no cap. Each listing returned is billed at $0.004 (see Pricing tab), so the default of 100 keeps a zero-config run cheap (~$0.45 incl. actor-start) — raise it, or set 0 for unlimited, once you know the volume you need.",
            "default": 100
          },
          "fetchDetails": {
            "title": "Fetch listing details",
            "type": "boolean",
            "description": "Visit each listing's detail page to add bathrooms, image count, full description and exact publish date. Slower (one extra request per listing). Automatically enabled when 'Min bathrooms' is set above 0.",
            "default": false
          },
          "onlyNewSinceLastRun": {
            "title": "Only new since last run",
            "type": "boolean",
            "description": "Only output listings not seen in previous runs with this flag. Seen listings aren't billed, so this saves you money on repeat runs. Uses an id cache scoped to this Actor (keyed by listing id, up to ~50k remembered ids). Only applies to search mode — a no-op when you pass explicit 'Listing URLs', since those are listings you asked for by name.",
            "default": false
          },
          "listingUrls": {
            "title": "Listing URLs (detail mode)",
            "type": "array",
            "description": "Optional: scrape these specific listing detail URLs (https://www.buyrentkenya.com/listings/...) instead of running a search.",
            "items": {
              "type": "string"
            }
          },
          "concurrency": {
            "title": "Detail-fetch concurrency",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Parallel workers for detail-page fetches.",
            "default": 4
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}