GET
# OpenTable Restaurant Search API

Find restaurants near a location for a given date, time, and party size.

## Overview

#### Restaurant list, not time slots

This endpoint returns matching restaurants with rich metadata. After choosing a restaurant, use Exact Availability for a yes/no check or Nearby Availability Slots for bookable alternatives.

The OpenTable Search endpoint discovers restaurants around a latitude/longitude for a specific reservation date, time, and party size. It returns up to 50 restaurants per call with cuisine, price band, guest rating, photos, structured address, phone, and feature flags (takeout, private dining, online ordering).

### Endpoint URL

GET https://api.stayapi.com/v1/opentable/search 

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| latitude | float | Required | Search-center latitude (-90 to 90). |
| longitude | float | Required | Search-center longitude (-180 to 180). |
| date | string | Required | Reservation date in `YYYY-MM-DD`. Cannot be in the past. |
| time | string | Required | Reservation time in `HH:MM` (24-hour), e.g. `19:00`. |
| party\_size | integer | Optional | Number of diners (1-30). Default: 2 |
| prices | integer[] | Optional | Price-band filter (1=$ … 4=$$$$). Repeatable — e.g. `prices=2&prices=3`. |
| metro\_id | integer | Optional | OpenTable metro id; narrows the search to a metro area. |
| limit | integer | Optional | Maximum restaurants to return (1-50). Default: 50 |
| offset | integer | Optional | Pagination offset (≥ 0). Default: 0 |

#### Search needs coordinates

OpenTable search is coordinate-based — there is no city-name search. Resolve a place name to latitude/longitude first, for example with the Meta Coordinates Lookup endpoint (GET /v1/meta/coordinates-lookup).

## Response Format

The response returns the list of matching restaurants for the search, each with cuisine, price band, rating, photos, address, phone, and feature flags.

### Response Structure

- **success** : Boolean indicating request success
- **total** : OpenTable's total match count for the search (may exceed the number returned)
- **restaurants** : Array of restaurant objects

## Restaurant Object Fields

| Field | Type | Description |
| --- | --- | --- |
| id | integer | OpenTable restaurant id. Stable. |
| name | string | Restaurant name |
| url | string | OpenTable restaurant page URL |
| primary\_cuisine | string | Primary cuisine, e.g. "French American" |
| dining\_style | string | Dining style, e.g. "Casual Elegant" |
| price\_band | object | Price band: `id` (1-4, maps to the `prices` filter), `name` (e.g. "$31 to $50"), `currency_symbol` |
| rating | float | Guest-review score (0-5). May be `null` for newly listed restaurants. |
| review\_count | integer | Same number as `text_review_count`; kept for backward compatibility. Prefer `text_review_count`. May be `null`. |
| text\_review\_count | integer | All-time count of reviews with written text. Matches `text_review_count` on Restaurant Details. May be `null`. |
| recent\_reservation\_count | integer | Recent reservations booked through OpenTable |
| neighborhood | string | Neighborhood name |
| coordinates | object | Restaurant `latitude` / `longitude` |
| address | object | Structured address: `line1`, `line2`, `city`, `state`, `postal_code` |
| phone | string | Restaurant phone number |
| photos | array | Ready-to-use CDN photo URLs |
| description | string | Plain-text restaurant description |
| max\_party\_size | integer | Largest party the restaurant accepts online |
| has\_takeout | boolean | Whether takeout is offered |
| order\_online\_link | string | Online-ordering link (may be `null`) |
| has\_private\_dining | boolean | Whether the restaurant offers private dining (see the Private Dining endpoint) |

#### total vs. returned count

total is OpenTable's full match count for the search and can exceed the number of restaurants returned (capped by limit, max 50). Page through additional matches with offset.

## Error Responses

The API returns standard HTTP error codes with detailed messages following the RFC 7807 Problem Details format. Failures carry `provider: "opentable"` and `product: "search"`.

### 400 Bad Request

An input failed validation. Possible `error_code` values: `INVALID_DATE_FORMAT` (date not `YYYY-MM-DD`), `PAST_DATE` (date before today), `INVALID_TIME_FORMAT` (time not `HH:MM`), `INVALID_PRICE_BAND` (a `prices` value outside 1-4).

```
{
  "type": "https://api.stayapi.com/errors/invalid-date-format",
  "title": "Invalid Date Format",
  "status": 400,
  "detail": "date must be in YYYY-MM-DD format",
  "provider": "opentable",
  "product": "search",
  "error_code": "INVALID_DATE_FORMAT"
}
```

### 422 Unprocessable Entity

A parameter is missing or out of range (e.g. bad coordinates, `limit` \> 50, `party_size` \> 30).

### 502 Bad Gateway

Upstream service error from OpenTable (`UPSTREAM_ERROR`).

## Usage Tips

### Best Practices

- Geocode a place name to coordinates first — pair this with the Meta Coordinates Lookup endpoint
- Filter by budget with one or more `prices` values (1-4); repeat the param to combine bands
- Use `limit` + `offset` to page; `total` tells you how many matches exist beyond the page
- Treat `rating`, `review_count` and `text_review_count` as nullable — newly listed restaurants may have none of them

#### Rate Limiting

This endpoint is subject to your plan's rate limits. Each search counts as one API call regardless of the number of results returned.

## Related Endpoints

### OpenTable Restaurant Menu

Fetch structured menus, item descriptions, string prices, and variations for a selected restaurant

[View Documentation →](/docs/endpoints/opentable/menu)

### OpenTable Exact Availability

Check whether one exact reservation time is currently available

[View Documentation →](/docs/endpoints/opentable/availability)

### OpenTable Nearby Slots

Return bookable alternatives around a preferred reservation time

[View Documentation →](/docs/endpoints/opentable/availability-slots)

### OpenTable Private Dining

Find venues that offer private dining, with contact and capacity details

[View Documentation →](/docs/endpoints/opentable/private-dining)

### Meta Coordinates Lookup

Resolve a place name into latitude/longitude for the search

[View Documentation →](/docs/endpoints/meta-coordinates-lookup)

Request

```curl
curl -X GET "https://api.stayapi.com/v1/opentable/search?latitude=34.0634&longitude=-118.2806&date=2026-06-23&time=19:00&party_size=2&prices=2&prices=3" \
  -H "X-API-Key: YOUR_API_KEY"
```

Response

```json
{
  "success": true,
  "total": 250,
  "restaurants": [
    {
      "id": 67720,
      "name": "Perch LA",
      "url": "https://www.opentable.com/perch",
      "primary_cuisine": "French American",
      "dining_style": "Casual Elegant",
      "price_band": { "id": 3, "name": "$31 to $50", "currency_symbol": "$" },
      "rating": 4.5,
      "review_count": 12360,
      "text_review_count": 12360,
      "recent_reservation_count": 1000,
      "neighborhood": "Downtown",
      "coordinates": { "latitude": 34.0480, "longitude": -118.2517 },
      "address": {
        "line1": "448 S Hill St",
        "line2": "",
        "city": "Los Angeles",
        "state": "CA",
        "postal_code": "90013"
      },
      "phone": "(213) 802-1770",
      "photos": [
        "https://resizer.otstatic.com/v4/photos/00000000-1?width=640&height=360"
      ],
      "description": "A rooftop bistro with French-inspired plates and skyline views.",
      "max_party_size": 20,
      "has_takeout": false,
      "order_online_link": null,
      "has_private_dining": true
    }
  ]
}
```

```json
{
  "type": "https://api.stayapi.com/errors/invalid-date-format",
  "title": "Invalid Date Format",
  "status": 400,
  "detail": "date must be in YYYY-MM-DD format",
  "instance": "/v1/opentable/search",
  "provider": "opentable",
  "product": "search",
  "error_code": "INVALID_DATE_FORMAT",
  "correlation_id": "req_abc123"
}
```
