{
  "openapi": "3.0.1",
  "info": {
    "title": "Yellow Pages Kenya Scraper - Kenya Business Directory",
    "description": "Scrape Yellow Pages Kenya (yellowpageskenya.com), Kenya's business directory. Browse by category, run a free-text search, or fetch full business profiles by URL. Get names, addresses, phone numbers, categories, regions, coordinates, and websites.",
    "version": "1.0",
    "x-build-id": "HCnwpBN86cLCPOCcq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~yellow-pages-kenya-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-yellow-pages-kenya-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/crawlerbros~yellow-pages-kenya-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-yellow-pages-kenya-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/crawlerbros~yellow-pages-kenya-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-yellow-pages-kenya-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "byCategory",
              "search",
              "detail"
            ],
            "type": "string",
            "description": "What to fetch: browse a category, run a free-text search, or fetch business profiles from direct yellowpageskenya.com URLs.",
            "default": "byCategory"
          },
          "category": {
            "title": "Category",
            "enum": [
              "custom",
              "hospitals",
              "hotels",
              "investments",
              "official",
              "business",
              "transporters",
              "boutiques",
              "pharmacies",
              "chemists-dispensing",
              "printers",
              "clinics",
              "clothing-retail",
              "colleges",
              "restaurants",
              "consultants",
              "accountants",
              "engineers",
              "stationery",
              "hardware-retail",
              "auctioneers",
              "bookshops",
              "architects",
              "co-operatives",
              "supermarkets",
              "photographers",
              "communications",
              "lodges",
              "associations",
              "garages",
              "auditors",
              "apartments",
              "bars",
              "supplies",
              "resorts",
              "opticians",
              "chemicals",
              "valuers",
              "publishers",
              "grocers",
              "water",
              "fabricators",
              "entertainers",
              "cafeterias",
              "jewellers",
              "manufacturers",
              "butcheries",
              "farms",
              "caterers",
              "clubs",
              "branding",
              "florists",
              "tents",
              "designers",
              "uniforms",
              "surveyors",
              "accommodation",
              "universities",
              "banks",
              "movers",
              "parastatals",
              "health-care",
              "videography",
              "taxicabs",
              "floriculture",
              "exporters",
              "horticulture",
              "hostels",
              "safaris",
              "signs",
              "typesetting",
              "herbalists",
              "aluminium",
              "tiles",
              "kindergartens",
              "landscaping",
              "generators",
              "cottages",
              "importers",
              "gymnasiums",
              "meat",
              "dry-cleaners",
              "fruits",
              "detergents",
              "beddings",
              "housewares-retail",
              "machinery",
              "investigators",
              "alarms",
              "polythene",
              "curios",
              "sports",
              "pumps",
              "foundations",
              "batteries",
              "motors",
              "gems",
              "poultry",
              "handicrafts",
              "fertilizers",
              "warehouses",
              "lubricants",
              "cameras",
              "physiotherapists",
              "vegetables",
              "mattresses",
              "laundries",
              "furnishings",
              "spices",
              "fabrics",
              "casinos",
              "inns",
              "engineering",
              "sawmills",
              "renovators",
              "e-commerce",
              "adhesives",
              "boilers",
              "locksmiths",
              "parks",
              "cables"
            ],
            "type": "string",
            "description": "Business category to browse. Pick a common category, or choose 'Custom category' and type your own below -- note only categories in this curated list are guaranteed to resolve via direct category browsing; for anything else use Search mode instead (mode=byCategory).",
            "default": "restaurants"
          },
          "customCategory": {
            "title": "Custom category (overrides selection above)",
            "type": "string",
            "description": "Free-text category not in the curated list above (mode=byCategory). Takes priority over 'Category' when set. Only works for simple, single-word-style category names (e.g. 'plumbers'); for category names containing '&' or commas, use Search mode instead."
          },
          "searchQuery": {
            "title": "Search query",
            "type": "string",
            "description": "Free-text keyword to search for -- matches business names and categories site-wide (mode=search), e.g. 'restaurants', 'hardware', 'Nairobi hotels'.",
            "default": "restaurants"
          },
          "region": {
            "title": "County / region",
            "enum": [
              "",
              "Mombasa",
              "Kwale",
              "Kilifi",
              "Tana River",
              "Lamu",
              "Taita-Taveta",
              "Garissa",
              "Wajir",
              "Mandera",
              "Marsabit",
              "Isiolo",
              "Meru",
              "Tharaka-Nithi",
              "Embu",
              "Kitui",
              "Machakos",
              "Makueni",
              "Nyandarua",
              "Nyeri",
              "Kirinyaga",
              "Murang'a",
              "Kiambu",
              "Turkana",
              "West Pokot",
              "Samburu",
              "Trans Nzoia",
              "Uasin Gishu",
              "Elgeyo-Marakwet",
              "Nandi",
              "Baringo",
              "Laikipia",
              "Nakuru",
              "Narok",
              "Kajiado",
              "Kericho",
              "Bomet",
              "Kakamega",
              "Vihiga",
              "Bungoma",
              "Busia",
              "Siaya",
              "Kisumu",
              "Homa Bay",
              "Migori",
              "Kisii",
              "Nyamira",
              "Nairobi"
            ],
            "type": "string",
            "description": "Only return businesses in this Kenyan county/region (matched against the business's own region and locality fields). Applied client-side across the fetched batch.",
            "default": ""
          },
          "sortBy": {
            "title": "Sort order",
            "enum": [
              "relevance",
              "rating",
              "name"
            ],
            "type": "string",
            "description": "How to order results after fetching. yellowpageskenya.com returns results in its own relevance/featured order, so 'rating' and 'name' are applied client-side across the fetched batch.",
            "default": "relevance"
          },
          "minRating": {
            "title": "Minimum rating",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Only return businesses rated at least this many stars, e.g. 4 for 4.0+. 0 means no minimum. Most listings have no rating yet; businesses with no rating are excluded once this is set above 0.",
            "default": 0
          },
          "fetchDetails": {
            "title": "Fetch full business profiles",
            "type": "boolean",
            "description": "For each result, also visit its business-details page to collect description, opening hours, payment methods accepted, and precise address. Slower -- one extra request per result.",
            "default": false
          },
          "businessUrls": {
            "title": "Business profile URLs (mode=detail)",
            "type": "array",
            "description": "Direct yellowpageskenya.com business-details URLs to fetch, e.g. https://www.yellowpageskenya.com/business-category/supermarkets/business-details/2852097-eastmatt-ltd. Use the 'sourceUrl' field from search/category results.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "title": "URL",
                  "type": "string",
                  "description": "yellowpageskenya.com business-details URL."
                }
              }
            },
            "default": []
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Hard cap on the number of business records to return.",
            "default": 20
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}