{"components":{"parameters":{"CategoryFilter":{"description":"Category id, name, or slug, e.g. \"restaurants\".","in":"query","name":"category","required":false,"schema":{"example":"restaurants","type":"string"}},"CityFilter":{"description":"City name or slug, e.g. \"Lahore\" or \"lahore\".","in":"query","name":"city","required":false,"schema":{"example":"Lahore","type":"string"}},"PageParam":{"description":"Page number, starting at 1.","in":"query","name":"page","required":false,"schema":{"default":1,"minimum":1,"type":"integer"}},"PerPageParam":{"description":"Results per page. Capped at 20 — requesting more returns 20.","in":"query","name":"per_page","required":false,"schema":{"default":20,"maximum":20,"minimum":1,"type":"integer"}},"SearchQuery":{"description":"Keyword search. For businesses: matches name, description, category, and city. For categories/cities: matches name and description.","in":"query","name":"q","required":false,"schema":{"example":"restaurants","type":"string"}}},"responses":{"NotFound":{"content":{"application/json":{"example":{"error":{"code":"not_found","hint":"Check the slug against the listing URL, or search by keyword at GET /api/v1/businesses?q=<keyword>.","message":"No public business found with slug \"unknown-slug\"."},"ok":false},"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"No resource matches the request."},"RateLimited":{"content":{"application/json":{"example":{"error":{"code":"rate_limited","hint":"Wait for the window to reset (see the Retry-After header), then retry.","message":"Too many requests. The public API allows 60 requests per minute per IP."},"ok":false},"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"Too many requests — 60 per minute per IP. Retry after the window resets (Retry-After header).","headers":{"RateLimit-Limit":{"description":"Requests allowed per window.","schema":{"example":60,"type":"integer"}},"RateLimit-Remaining":{"description":"Requests left in the current window.","schema":{"type":"integer"}},"RateLimit-Reset":{"description":"Seconds until the window resets.","schema":{"type":"integer"}},"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}}}},"Unauthorized":{"content":{"application/json":{"example":{"error":{"code":"unauthorized","hint":"Remove the Authorization header: public reads need no credentials. Listing owners sign in on the website itself — see https://www.localepak.com/auth.md.","message":"LocalePak issues no API tokens, so no bearer token is valid here."},"ok":false},"schema":{"$ref":"#/components/schemas/ErrorBody"}}},"description":"An Authorization header was sent. LocalePak issues no API tokens, so no bearer token is valid here; public reads need no credentials.","headers":{"WWW-Authenticate":{"description":"Bearer challenge pointing at the protected-resource metadata.","schema":{"example":"Bearer realm=\"LocalePak\", error=\"invalid_token\", resource_metadata=\"https://www.localepak.com/.well-known/oauth-protected-resource\"","type":"string"}}}}},"schemas":{"ApiBusiness":{"description":"A public business listing. Only fields already public on the listing page are included.","properties":{"category":{"example":"Technology & IT","type":"string"},"city":{"example":"Islamabad","type":"string"},"description":{"example":"Nayatel is listed on LocalePak under Technology & IT in Islamabad, Pakistan.","type":"string"},"featured":{"description":"True when the listing is on the paid Featured tier or admin-featured.","example":false,"type":"boolean"},"name":{"example":"Nayatel","type":"string"},"phone":{"description":"Public contact phone as listed, or an empty string when the listing has none.","example":"051-111-144-444","type":"string"},"slug":{"example":"nayatel","type":"string"},"url":{"description":"Canonical public listing page.","example":"https://www.localepak.com/business/nayatel/","format":"uri","type":"string"},"website":{"description":"The business's own website, present only when the owner supplied one.","format":"uri","type":"string"}},"required":["name","slug","category","city","phone","description","featured","url"],"type":"object"},"ApiCategory":{"properties":{"description":{"example":"Find local cafes, fine dining, fast food, and food caterers","type":"string"},"id":{"example":"restaurants","type":"string"},"name":{"example":"Restaurants & Food","type":"string"},"url":{"example":"https://www.localepak.com/category/restaurants/","format":"uri","type":"string"}},"required":["id","name","description","url"],"type":"object"},"ApiCity":{"properties":{"name":{"example":"Lahore","type":"string"},"slug":{"example":"lahore","type":"string"},"url":{"example":"https://www.localepak.com/city/lahore/","format":"uri","type":"string"}},"required":["name","slug","url"],"type":"object"},"BusinessListResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ApiBusiness"},"type":"array"},"ok":{"example":true,"type":"boolean"},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["ok","data","pagination"],"type":"object"},"CategoryListResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ApiCategory"},"type":"array"},"ok":{"example":true,"type":"boolean"},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["ok","data","pagination"],"type":"object"},"CityListResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/ApiCity"},"type":"array"},"ok":{"example":true,"type":"boolean"},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["ok","data","pagination"],"type":"object"},"ErrorBody":{"properties":{"error":{"properties":{"code":{"description":"Machine-readable error code: bad_request, not_found, unauthorized, rate_limited, method_not_allowed, internal_error.","example":"not_found","type":"string"},"hint":{"description":"What to do next — the resolution for this error.","type":"string"},"message":{"description":"Human-readable summary of what went wrong.","type":"string"}},"required":["code","message","hint"],"type":"object"},"ok":{"example":false,"type":"boolean"}},"required":["ok","error"],"type":"object"},"Pagination":{"properties":{"page":{"example":1,"type":"integer"},"per_page":{"example":20,"type":"integer"},"total":{"description":"Total matching items across all pages.","type":"integer"},"total_pages":{"type":"integer"}},"required":["page","per_page","total","total_pages"],"type":"object"}},"securitySchemes":{"bearerAuth":{"description":"Honest note: LocalePak currently issues NO bearer tokens and has no token endpoint, so this scheme is documented for completeness only — do not send an Authorization header. Public reads (all operations in this document) require no authentication (security: []). Scopes used by LocalePak: \"listings:read\" (public read-only access — no token needed) and \"listings:write\" (listing-owner writes, which happen only in a signed-in website session at https://www.localepak.com/dashboard — never through this API). See /.well-known/oauth-authorization-server and /.well-known/oauth-protected-resource.","scheme":"bearer","type":"http"}}},"info":{"contact":{"email":"support@localepak.com","name":"LocalePak Support","url":"https://www.localepak.com/contact"},"description":"Read-only public API for LocalePak, Pakistan's business directory (183 cities, 24 categories). All reads are free and need no API key, token, or signup. At most 20 results per page; 60 requests per minute per IP. Only fields that are already public on the listing pages are returned — name, slug, category, city, phone, description, featured flag, the business's own public website link when supplied, and the public listing URL. Owner emails, owner IDs, and payment data are never exposed, and there is no bulk-export endpoint. Listing owners add or manage listings by signing in on the website itself (see https://www.localepak.com/auth.md). There are no write endpoints.","license":{"name":"Use as documented — cite the listing page URL you used. Do not scrape in bulk."},"title":"LocalePak Public API","version":"1.0.0"},"openapi":"3.1.0","paths":{"/api/mcp":{"post":{"description":"Model Context Protocol server over Streamable HTTP (stateless, JSON responses). Tools: search_businesses, get_business, list_categories, list_cities — the same read-only public data as the REST API, with the same 20-result cap and 60 requests/minute/IP limit. Send a JSON-RPC 2.0 request (initialize, tools/list, tools/call). No authentication: reads are free and need no key.","operationId":"mcpStreamableHttp","requestBody":{"content":{"application/json":{"examples":{"searchBusinesses":{"summary":"Search businesses via a tool call","value":{"id":2,"jsonrpc":"2.0","method":"tools/call","params":{"arguments":{"city":"Lahore","q":"restaurants"},"name":"search_businesses"}}},"toolsList":{"summary":"List the available tools","value":{"id":1,"jsonrpc":"2.0","method":"tools/list"}}},"schema":{"properties":{"id":{"type":["string","integer"]},"jsonrpc":{"const":"2.0","type":"string"},"method":{"example":"tools/list","type":"string"},"params":{"type":"object"}},"required":["jsonrpc","method"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"error":{"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"},"id":{"type":["string","integer"]},"jsonrpc":{"const":"2.0","type":"string"},"result":{"type":"object"}},"required":["jsonrpc"],"type":"object"}}},"description":"JSON-RPC 2.0 response (or a JSON-RPC error object for a failed call)."},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[],"summary":"MCP endpoint (Streamable HTTP, JSON-RPC 2.0)","tags":["MCP"]}},"/api/v1/businesses":{"get":{"description":"Search approved public business listings by keyword, city, and/or category. Results are paginated (max 20 per page). Only already-public fields are returned.","operationId":"listBusinesses","parameters":[{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/CityFilter"},{"$ref":"#/components/parameters/CategoryFilter"},{"$ref":"#/components/parameters/PageParam"},{"$ref":"#/components/parameters/PerPageParam"}],"responses":{"200":{"content":{"application/json":{"example":{"data":[{"category":"Technology & IT","city":"Islamabad","description":"Nayatel is listed on LocalePak under Technology & IT in Islamabad, Pakistan.","featured":false,"name":"Nayatel","phone":"051-111-144-444","slug":"nayatel","url":"https://www.localepak.com/business/nayatel/"}],"ok":true,"pagination":{"page":1,"per_page":20,"total":1,"total_pages":1}},"schema":{"$ref":"#/components/schemas/BusinessListResponse"}}},"description":"A page of public business listings."},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[],"summary":"Search public business listings","tags":["Businesses"]}},"/api/v1/businesses/{slug}":{"get":{"description":"Return a single approved public business listing by its slug — the slug in its public URL, e.g. \"nayatel\" for https://www.localepak.com/business/nayatel/.","operationId":"getBusinessBySlug","parameters":[{"description":"The business slug from its public listing URL.","in":"path","name":"slug","required":true,"schema":{"example":"nayatel","type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"data":{"$ref":"#/components/schemas/ApiBusiness"},"ok":{"example":true,"type":"boolean"}},"required":["ok","data"],"type":"object"}}},"description":"The public business listing."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[],"summary":"Get one public business by slug","tags":["Businesses"]}},"/api/v1/categories":{"get":{"description":"List all 24 LocalePak business categories with their id, name, description, and public category URL. Optionally filter by keyword with q.","operationId":"listCategories","parameters":[{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/PageParam"},{"$ref":"#/components/parameters/PerPageParam"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CategoryListResponse"}}},"description":"A page of categories."},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[],"summary":"List the 24 directory categories","tags":["Categories"]}},"/api/v1/cities":{"get":{"description":"List the 183 Pakistani cities LocalePak covers, with name, slug, and public city URL. Optionally filter by keyword with q. Paginated (max 20 per page).","operationId":"listCities","parameters":[{"$ref":"#/components/parameters/SearchQuery"},{"$ref":"#/components/parameters/PageParam"},{"$ref":"#/components/parameters/PerPageParam"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CityListResponse"}}},"description":"A page of cities."},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/RateLimited"}},"security":[],"summary":"List the 183 covered cities","tags":["Cities"]}}},"servers":[{"description":"Production","url":"https://www.localepak.com"}],"tags":[{"description":"Public business listings.","name":"Businesses"},{"description":"The 24 directory categories.","name":"Categories"},{"description":"The 183 covered cities.","name":"Cities"},{"description":"Model Context Protocol endpoint exposing the same read-only data as tools.","name":"MCP"}]}