# /yelp/businesses/search

`POST /api/yelp/businesses/search`

Price: 20 credits

Search Yelp businesses by location and term or category, with the full on-site filter surface: price level, business features, dietary restrictions, open now or open at a given time, search radius and result ordering. Returns businesses with name, rating, review count, price range, phone, address, coordinates, categories, business highlights, verified trade licences and a matching review snippet.

## How to use it

Search Yelp local businesses. location is required ('San Francisco, CA', 'London', a postcode or an address) plus at least one of term ('pizza', 'dentist') or category (Yelp category alias such as 'restaurants', 'hotels', 'autorepair'). Optional filters: price (1-4 dollar signs), features (outdoor seating, offers delivery, wheelchair accessible, takes reservations, parking, wifi and more), dietary_restrictions (halal/vegan/vegetarian), open_now, open_time ('19:00' for businesses open at 7pm local time), radius (four_blocks to birds_eye), include_ads and sort_by (recommended/rating/review_count). Each result has id, alias, url, name, image/images, rating, review_count, price_range, phone, address, latitude/longitude, categories, highlights (owner-declared selling points such as 'Full bar' or 'Private events'), licenses (trade licences Yelp verified with the issuing authority: number, issuer, trade, licensee, expiry and verification dates - common for plumbers, electricians and other contractors), review_snippet, ranking and is_ad.

## Parameters

- `access-token` (string, required)

## Request body

- `timeout` (integer) — Max scrapping execution timeout (in seconds) (default: 300; min: 20; max: 1500)
- `location` (string, required) — Place to search in: city, address, postcode or neighbourhood (examples: "San Francisco, CA", "New York, NY", "London"; minLength: 1)
- `term` (string, nullable) — What to search for (examples: "pizza", "dentist", "auto repair")
- `category` (string, nullable) — Restrict results to one Yelp category alias (examples: "restaurants", "pizza", "dentists", "hotels", "autorepair")
- `sort_by` (string) — Result ordering (default: "recommended"; one of: "recommended", "rating", "review_count")
- `price` (array) — Price levels to include, from 1 ($) to 4 ($$$$) (default: []; one of: "1", "2", "3", "4")
- `features` (array) — Business features that must be present (default: []; one of: "accepts_credit_cards", "accepts_apple_pay", "accepts_cryptocurrency", "open_to_all", "by_appointment_only", "dogs_allowed", "good_for_kids", "good_for_groups", "gender_neutral_restrooms", "wheelchair_accessible", "outdoor_seating", "open_24_hours", "hot_and_new", "happy_hour", "has_tv", "coat_check", "waiter_service", "takes_reservations", "online_reservations", "online_waitlist", "online_booking", "spa_booking", "service_booking", "request_a_quote", "offers_delivery", "offers_takeout", "free_delivery", "cheap_delivery", "fast_delivery", "flower_delivery", "offers_military_discount", "full_bar", "beer_and_wine", "good_for_breakfast", "good_for_brunch", "good_for_lunch", "good_for_dinner", "good_for_dessert", "good_for_late_night", "garage_parking", "lot_parking", "street_parking", "valet_parking", "validated_parking", "music_dj", "music_jukebox", "music_karaoke", "music_live", "smoking_no", "smoking_outdoor", "smoking_yes", "free_wifi", "paid_wifi", "liked_by_twenties", "liked_by_thirties", "liked_by_forties", "liked_by_vegetarians")
- `dietary_restrictions` (array) — Dietary restrictions the business must serve (default: []; one of: "halal", "vegan", "vegetarian")
- `open_now` (boolean) — Only businesses open at request time (default: false)
- `open_time` (string, nullable) — Only businesses open at this local time of day, as HH:MM on a 24-hour clock (examples: "19:00", "08:30"; pattern: ^([01]\d|2[0-3]):[0-5]\d$)
- `radius` (string, nullable) — Limit results to an area around the location (one of: "four_blocks", "one_mile", "two_miles", "five_miles", "birds_eye")
- `include_ads` (boolean) — Also return promoted businesses, flagged with is_ad (default: false)
- `count` (integer, required) — Max number of results to return (min: 1; max: 240)

## Response

### 200 — Successful Response

- `@type` (string) (default: "YelpSearchBusiness")
- `id` (string, required)
- `alias` (string, nullable)
- `url` (string, nullable)
- `name` (string, nullable)
- `image` (string, nullable)
- `images` (array) (default: [])
- `rating` (number, nullable)
- `review_count` (integer, nullable)
- `price_range` (string, nullable)
- `phone` (string, nullable)
- `address` (object, nullable)
  - `@type` (string) (default: "YelpBusinessAddress")
  - `line1` (string, nullable)
  - `line2` (string, nullable)
  - `line3` (string, nullable)
  - `city` (string, nullable)
  - `region_code` (string, nullable)
  - `postal_code` (string, nullable)
  - `country_code` (string, nullable)
- `latitude` (number, nullable)
- `longitude` (number, nullable)
- `categories` (array) (default: [])
  - `@type` (string) (default: "YelpBusinessCategory")
  - `id` (string, required)
  - `alias` (string, required)
  - `category_title` (string, nullable)
  - `root_alias` (string, nullable)
- `highlights` (array) (default: [])
  - `@type` (string) (default: "YelpBusinessHighlight")
  - `id` (string, required)
  - `name` (string, nullable)
- `licenses` (array) (default: [])
  - `@type` (string) (default: "YelpBusinessLicense")
  - `number` (string, nullable)
  - `issued_by` (string, nullable)
  - `trade` (string, nullable)
  - `licensee` (string, nullable)
  - `expiry_date` (string, nullable)
  - `verified_date` (string, nullable)
- `review_snippet` (string, nullable)
- `ranking` (integer, nullable)
- `is_ad` (boolean) (default: false)

## Errors

### 422 — Validation Error

The request body did not validate

What to do: Check the fields against this schema. A URN with the wrong prefix is the most common cause.

- `detail` (array)
  - `loc` (array, required)
  - `msg` (string, required)
  - `type` (string, required)
  - `input` (any)
  - `ctx` (object)

### 408

The request ran past its time limit

What to do: Raise `timeout` in the request body, up to the maximum this endpoint documents. Lowering `count` or turning off the `with_*` flags also helps, because less work finishes sooner.

### 412

The entity was not found, or a precondition failed

What to do: Retrying will not help: either the entity does not exist, or the input points at a different one.

### 429

Too many requests: a rate limit or a usage window is exhausted

What to do: When the response carries an X-Retry-After header, wait that many seconds and retry: the same number is in the body as `detail.retry_after`, and the limit clears once that window passes. The message in the body names the limit that was hit.

### 500

Something broke on our side

What to do: Retrying will not help. If it keeps happening, send us the X-Request-ID from the response headers.

### 529

Rate limit reached, or the endpoint is overloaded

What to do: Wait at least 30 seconds, then retry.

## Response envelope

Success: Array of objects (may be empty if no results)

Error: Error may coexist with partial results if it occurs mid-execution. Check X-Error header and status code.

Every response carries these headers:

- `X-Error` — Error message text (present only on error)
- `X-Request-ID` — Unique request identifier
- `X-Execution-Time` — Execution time in seconds
- `X-Result-Count` — How many records the body carries. 0 means an empty result, which is a normal answer and not by itself an error. A non-zero count can come back together with X-Error when the failure happened partway through — read this header and X-Error independently.
- `X-Total-Available-Results` — How many records exist for this query, when the endpoint can say. On a `dry_run` request this is the answer and the body is empty. It saturates: the endpoint's documented maximum means 'at least that many', any smaller number is exact.
- `X-Warning` — Present when the request body carried keys this endpoint does not document. They were ignored, so any filter you meant to apply through them did not apply. Check the spelling against this schema and retry.
- `X-Retry-After` — Seconds to wait before retrying. Present only on 429.

