{
  "openapi": "3.0.1",
  "info": {
    "title": "Yellow Pages PK Scraper - Pakistan Business Directory",
    "description": "Scrape YellowPagesPK.com, Pakistan's business listing directory. Browse by business category, search by keyword or city, or fetch full business profiles by URL. Get names, addresses, phone numbers, emails, websites, categories, and more.",
    "version": "1.0",
    "x-build-id": "qNG2BmfrtQ9jFyDEd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/crawlerbros~yellow-pages-pk-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-crawlerbros-yellow-pages-pk-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-pk-scraper/runs": {
      "post": {
        "operationId": "runs-sync-crawlerbros-yellow-pages-pk-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-pk-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-crawlerbros-yellow-pages-pk-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",
              "byUrls"
            ],
            "type": "string",
            "description": "What to fetch: browse a business category, run a free-text keyword search across the whole directory, or fetch full business profiles from direct YellowPagesPK.com listing URLs.",
            "default": "byCategory"
          },
          "category": {
            "title": "Business category (mode=byCategory)",
            "enum": [
              "account-tax-consultant",
              "arts-entertainment",
              "automotive",
              "beauty-salon",
              "beauty-spa",
              "best-event-management",
              "charity-donation",
              "computer-and-mobiles",
              "construction",
              "constructions-repairing",
              "courier-service",
              "customs-broker-clearance-agent",
              "digital-media",
              "education-institute",
              "electronics-and-electrical-equipment",
              "fashion-styles",
              "furniture",
              "general-order-supplier",
              "goods-transportation",
              "health-medical",
              "home-furniture",
              "home-garden",
              "hotels",
              "insurance",
              "job-recruitment-agency",
              "law-firms",
              "legal-advisor",
              "legal-service",
              "loan-and-mortgage",
              "manufacturer",
              "movers-packers",
              "property-real-estate-agent",
              "real-estate",
              "rent-a-car",
              "restaurant",
              "security-service",
              "services",
              "shopping",
              "software-houses",
              "specialist-medical-doctors",
              "study-abroad",
              "study-abroad-consultants",
              "travel-agencies",
              "vehicle-denter-painter",
              "web-development",
              "welder"
            ],
            "type": "string",
            "description": "Business category to browse. This is the full, current list of categories published on YellowPagesPK.com (mode=byCategory).",
            "default": "restaurant"
          },
          "cityFilter": {
            "title": "City filter (optional)",
            "type": "string",
            "description": "Only keep businesses whose address mentions this city, e.g. 'Lahore', 'Karachi', 'Islamabad'. Matched case-insensitively against the business address. Leave empty for no city filter (used in mode=byCategory and mode=search)."
          },
          "searchQuery": {
            "title": "Search query (mode=search)",
            "type": "string",
            "description": "Free-text keyword to search for across YellowPagesPK.com, e.g. a business name, service, or city (mode=search). Matches the site's own search, so combining a service with a city (e.g. 'restaurant lahore') narrows results well."
          },
          "listingUrls": {
            "title": "Business listing URLs (mode=byUrls)",
            "type": "array",
            "description": "Direct YellowPagesPK.com listing URLs to fetch, e.g. https://yellowpagespk.com/listing/andaaz-restaurant/. Use the 'sourceUrl' field from byCategory/search results.",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "title": "URL",
                  "type": "string",
                  "description": "YellowPagesPK.com listing URL."
                }
              }
            },
            "default": []
          },
          "minRating": {
            "title": "Minimum rating",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Only include businesses with an average customer rating at or above this value (0-5 stars). 0 = no filter. Businesses with no published rating are excluded once this is set above 0. Ratings are only available on the listing/search card, not looked up separately.",
            "default": 0
          },
          "onlyClaimed": {
            "title": "Only claimed/verified businesses",
            "type": "boolean",
            "description": "Only include businesses whose listing has been claimed and verified by its owner on YellowPagesPK.com. Off by default (returns both claimed and unclaimed listings).",
            "default": false
          },
          "fetchDetails": {
            "title": "Fetch full business profiles",
            "type": "boolean",
            "description": "For each result, also visit its listing page to collect description, email, website, category, claimed status, and owner profile (one extra request per result). When off, only the fields visible on the listing/search page are returned (mode=byCategory, mode=search).",
            "default": true
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Hard cap on the number of business records to return.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}