GET
# OpenTable Private Dining API

Find venues that offer private dining near a location, with contact and capacity details.

## Overview

#### Directory search — no date or party size

This targets OpenTable's private-dining sub-site, so it is a directory search, not an availability search: there is no date, time, or party size. There is also no city-name search — resolve a place to coordinates first, e.g. with the Meta Coordinates Lookup endpoint (GET /v1/meta/coordinates-lookup).

The OpenTable Private Dining endpoint finds restaurants that offer private dining around a latitude/longitude. Each result carries the private-dining event contact (name, phone, email), the largest-space capacity, the number of spaces, and an instant-bookable flag — alongside cuisine, price band, rating, neighborhood, coordinates, and photos.

### Endpoint URL

GET https://api.stayapi.com/v1/opentable/private-dining 

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| latitude | float | Required | Search-center latitude (-90 to 90). |
| longitude | float | Required | Search-center longitude (-180 to 180). |
| cuisine\_ids | string[] (UUID) | Optional | OpenTable cuisine UUIDs. **Discover them** by calling once with `with_facets=true`. Repeatable for multiple cuisines. |
| instant\_book | boolean | Optional | If `true`, return only instantly-bookable venues. |
| radius | integer | Optional | Search radius in miles (1-100). Default: 50 |
| min\_capacity | integer | Optional | Only venues whose largest space seats at least this many (≥ 1). Applied by StayAPI — see the capacity note below. |
| scan\_offset | integer | Optional | Continue a `min_capacity` search: pass the `next_scan_offset` from the previous response (≥ 0). Ignored without `min_capacity`. Default: 0 |
| metro\_id | integer | Optional | OpenTable metro id; narrows the search to a metro area. |
| with\_facets | boolean | Optional | If `true`, include `facets.cuisines` (name → `cuisine_id` → count). Default: false |
| limit | integer | Optional | Maximum restaurants to return (1-50). Default: 50 |
| offset | integer | Optional | Pagination offset (≥ 0). Default: 0 |

#### Discover cuisine IDs with facets

cuisine\_ids are opaque OpenTable cuisine UUIDs (not the 1-4 price values). Call once with with\_facets=true to get facets.cuisines — each entry maps a cuisine name to its cuisine\_id and a count — then pass the UUIDs you want back as cuisine\_ids.

## Response Format

The response returns matching private-dining venues, plus counters describing the capacity filter and optional cuisine facets.

### Response Structure

- **success** : Boolean indicating request success
- **total** : Match count — metro-wide when `min_capacity` is omitted, or, when it is set, the count of matches _within the venues checked by this request_
- **server\_total** : Metro-wide pre-filter total (non-null only when `min_capacity` is set)
- **searched\_count** : Number of venues scanned for the capacity filter (≤ 250)
- **capacity\_filter\_truncated** : `true` if the metro exceeded the 250-venue scan cap
- **next\_scan\_offset** : Integer to pass as `scan_offset` to check the next venues when `capacity_filter_truncated` is `true`; `null` once every venue in the area has been checked, and always `null` without `min_capacity`
- **restaurants** : Array of venue objects
- **facets** : Cuisine facets — `null` unless `with_facets=true`

## Venue Object Fields

| Field | Type | Description |
| --- | --- | --- |
| id | integer | OpenTable restaurant id. Stable. |
| name | string | Restaurant name |
| url | string | OpenTable private-dining profile URL |
| primary\_cuisine | string | Primary cuisine, e.g. "Pan-Asian" |
| price\_band | object | Price band: `id` (1-4), `name` (e.g. "$31 to $50"), `currency_symbol` |
| rating | float | Guest-review score (0-5). May be `null`. |
| review\_count | integer | All-time text-review count. May be `null`. |
| neighborhood | string | Neighborhood name |
| coordinates | object | Restaurant `latitude` / `longitude` |
| photos | array | Ready-to-use CDN photo URLs |
| is\_instant\_bookable | boolean | Whether the venue is instantly bookable |
| space\_count | integer | Number of private-dining spaces |
| private\_dining | object | Private-dining details: `contact`, `phone`, `email`, `largest_capacity` (seats in the biggest space), `description` |

#### How the capacity filter works

OpenTable has no native capacity filter, so StayAPI applies min\_capacity itself. It scans up to 250 venues, filters them, and reports server\_total (metro-wide pre-filter total), searched\_count (how many it scanned), and capacity\_filter\_truncated (true when the metro had more than 250 venues, so matches beyond the scanned window may exist — continue with scan\_offset=next\_scan\_offset, see below). facets are metro-wide and are NOT recomputed against min\_capacity — when both are set, facet counts will exceed total.

## Searching large areas with min\_capacity

Each request checks up to 250 venues for `min_capacity`. Large metros such as New York can have more, so the first response may set `capacity_filter_truncated: true` and return a `next_scan_offset`. Call again with the same parameters plus `scan_offset=<next_scan_offset>` to check the next venues, and repeat until `next_scan_offset` is `null`.

### 1. First request

```
curl -X GET "https://api.stayapi.com/v1/opentable/private-dining?latitude=40.7580&longitude=-73.9855&min_capacity=100" \
  -H "X-API-Key: YOUR_API_KEY"
```

Read `next_scan_offset` from the response:

```
{
  "success": true,
  "total": 38,
  "searched_count": 250,
  "capacity_filter_truncated": true,
  "next_scan_offset": 250,
  "restaurants": [...]
}
```

### 2. Continue with scan\_offset

```
curl -X GET "https://api.stayapi.com/v1/opentable/private-dining?latitude=40.7580&longitude=-73.9855&min_capacity=100&scan_offset=250" \
  -H "X-API-Key: YOUR_API_KEY"
```

When `next_scan_offset` comes back `null`, every venue in the area has been checked.

- `total` counts matches within the venues checked by that request; `offset`/`limit` page through those matches.
- Keep every other parameter the same between calls. A `scan_offset` past the end returns an empty list with `next_scan_offset: null`.
- Venue ordering can shift between requests, so dedupe results by `id` across calls.
- Each continuation call is billed as a separate request.

## 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: "private-dining"`.

### 400 Bad Request

A `cuisine_ids` value is not a valid UUID (`INVALID_CUISINE_ID`).

```
{
  "type": "https://api.stayapi.com/errors/invalid-cuisine-id",
  "title": "Invalid Cuisine ID",
  "status": 400,
  "detail": "cuisine_ids must be valid UUIDs",
  "provider": "opentable",
  "product": "private-dining",
  "error_code": "INVALID_CUISINE_ID"
}
```

### 422 Unprocessable Entity

A parameter is missing or out of range (e.g. bad coordinates, `radius` \> 100, `min_capacity` \< 1, `scan_offset` \< 0, `limit` \> 50).

### 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
- Do a first call with `with_facets=true` to discover the `cuisine_id` UUIDs, then filter with `cuisine_ids`
- When using `min_capacity`, check `capacity_filter_truncated` — if `true`, call again with `scan_offset=next_scan_offset` to check the next venues
- Use `private_dining.largest_capacity` and `space_count` to match the venue to your event size

#### 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 Search

Find restaurants by location for a date, time, and party size

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

### 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/private-dining?latitude=32.8959&longitude=-97.0671&with_facets=true&min_capacity=100" \
  -H "X-API-Key: YOUR_API_KEY"
```

Response

```json
{
  "success": true,
  "total": 117,
  "server_total": 178,
  "searched_count": 178,
  "capacity_filter_truncated": false,
  "next_scan_offset": null,
  "restaurants": [
    {
      "id": 1331095,
      "name": "Soy Cowboy",
      "url": "https://www.opentable.com/private-dining/profile/soy-cowboy",
      "primary_cuisine": "Pan-Asian",
      "price_band": { "id": 3, "name": "$31 to $50", "currency_symbol": "$" },
      "rating": 4.6,
      "review_count": 212,
      "neighborhood": "Arlington",
      "coordinates": { "latitude": 32.7503, "longitude": -97.0847 },
      "photos": [
        "https://resizer.otstatic.com/v4/photos/65907279-1?width=480&height=270"
      ],
      "is_instant_bookable": true,
      "space_count": 4,
      "private_dining": {
        "contact": "The Sales Event Manager",
        "phone": "(713) 804-3317",
        "email": "events@example.com",
        "largest_capacity": 200,
        "description": "Soy Cowboy offers a vibrant yet intimate setting for private events."
      }
    }
  ],
  "facets": {
    "cuisines": [
      { "cuisine_id": "8afc7adc-de3b-439d-91f2-ce568c1a653b", "name": "American", "count": 75 }
    ]
  }
}
```

```json
{
  "type": "https://api.stayapi.com/errors/invalid-cuisine-id",
  "title": "Invalid Cuisine ID",
  "status": 400,
  "detail": "cuisine_ids must be valid UUIDs",
  "instance": "/v1/opentable/private-dining",
  "provider": "opentable",
  "product": "private-dining",
  "error_code": "INVALID_CUISINE_ID",
  "correlation_id": "req_abc123"
}
```
