# OpenTable — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Search for restaurants across the US with ratings, reviews, photos, and pricing information, plus get real-time availability and autocomplete suggestions as you type. Check reservation openings and explore detailed restaurant features to find and book your perfect dining experience.

**Category:** Food & Dining | **Website:** [www.opentable.com/](https://www.opentable.com/) | **Docs:** [parse.bot/marketplace/e4451e98-89a2-4b50-a334-ea6727a0a12c/opentable-com-api](https://parse.bot/marketplace/e4451e98-89a2-4b50-a334-ea6727a0a12c/opentable-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-opentable-com-api-e4451e98/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### autocomplete

Get autocomplete suggestions for restaurants, cuisines, and locations based on a search term. Returns typed suggestions with geographic metadata when available. Useful for building search UIs with typeahead functionality.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `latitude` | number | No | Latitude to bias results |
| `longitude` | number | No | Longitude to bias results |
| `term` | string | Yes | Search term to autocomplete |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-opentable-com-api-e4451e98/autocomplete \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"latitude":"<number>","longitude":"<number>","term":"<string>"}'
```

### batch_availability

Batch-resolve restaurant names by city and check availability for each. For each {name, city} pair, searches OpenTable to find the best-matching restaurant, then checks availability for all resolved restaurants in one batch call. Returns each input mapped to its resolved restaurant details (name, restaurant_id, address, cuisine, rating) and available time slots. Makes N+1 upstream round-trips (one search per input pair plus one batch availability call). Unresolved pairs appear with resolved=false and empty availability.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | No | Date in YYYY-MM-DD format. Defaults to tomorrow. |
| `party_size` | integer | No | Number of diners |
| `restaurants` | string | Yes | JSON array of objects, each with 'name' (required) and 'city' (optional) fields, e.g. [{"name": "Nobu", "city": "New York"}, {"name": "Alinea", "city": "Chicago"}] |
| `time` | string | No | Time in HH:MM format (24h) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-opentable-com-api-e4451e98/batch_availability \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"<string>","party_size":"<integer>","restaurants":"<string>","time":"<string>"}'
```

### location_lookup

Resolve geographic coordinates to OpenTable metro, macro, and neighborhood information. Returns structured location hierarchy useful for getting metro_id to pass to search_restaurants. A single round-trip returning the nearest metro, macro-region, and neighborhood.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `latitude` | number | No | Latitude |
| `longitude` | number | No | Longitude |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-opentable-com-api-e4451e98/location_lookup \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"latitude":"<number>","longitude":"<number>"}'
```

### restaurant_availability

Check reservation availability for specific restaurants on a given date/time/party size. Accepts restaurant IDs directly or a restaurant name to resolve. When restaurant_name is provided without restaurant_ids, searches OpenTable for the best match and checks its availability. When both are provided, restaurant_ids takes precedence. The optional location parameter biases the name resolution toward a specific city or area. Returns time slots with availability status, points rewards, and slot hashes. Accepts multiple restaurant IDs in one call for efficient batch lookups. Restaurant IDs come from search_restaurants results.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | No | Date in YYYY-MM-DD format. Defaults to tomorrow. |
| `location` | string | No | City or location string to bias restaurant name resolution (e.g. 'New York', 'Chicago'). Only used when resolving by restaurant_name; ignored when restaurant_ids is provided. |
| `party_size` | integer | No | Number of diners |
| `restaurant_ids` | string | No | Comma-separated restaurant IDs (get from search_restaurants results[*].restaurant_id). Takes precedence over restaurant_name when both are provided. |
| `restaurant_name` | string | No | Restaurant name to search for. When provided without restaurant_ids, resolves to the best-matching restaurant via OpenTable search. Ignored if restaurant_ids is also provided. |
| `time` | string | No | Time in HH:MM format (24h) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-opentable-com-api-e4451e98/restaurant_availability \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"<string>","location":"<string>","party_size":"<integer>","restaurant_ids":"<string>","restaurant_name":"<string>","time":"<string>"}'
```

### search_restaurants

Search for restaurants by keyword, location, date/time, party size, and various filters. Returns paginated results with comprehensive restaurant details including name, cuisine, ratings, reviews, photos, address, phone, and features. Paginates via page number. Each restaurant includes a restaurant_id usable with restaurant_availability.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `cuisine_ids` | string | No | Comma-separated cuisine filter IDs |
| `date` | string | No | Date in YYYY-MM-DD format. Defaults to tomorrow. |
| `latitude` | number | No | Latitude of search center |
| `longitude` | number | No | Longitude of search center |
| `metro_id` | integer | No | Metro ID (auto-resolved from coordinates if not provided). Use location_lookup to find IDs. |
| `page` | integer | No | Page number (1-based) |
| `page_size` | integer | No | Results per page (max 50) |
| `party_size` | integer | No | Number of diners |
| `prices` | string | No | Comma-separated price band IDs (1=under $15, 2=$30 and under, 3=$31-50, 4=$50+) |
| `sort_by` | string | No | Sort order for results |
| `term` | string | No | Search term (e.g., 'Italian', 'sushi', 'steakhouse', 'pizza'). Leave empty to browse all restaurants. |
| `time` | string | No | Time in HH:MM format (24h) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-opentable-com-api-e4451e98/search_restaurants \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"cuisine_ids":"<string>","date":"<string>","latitude":"<number>","longitude":"<number>","metro_id":"<integer>","page":"<integer>","page_size":"<integer>","party_size":"<integer>","prices":"<string>","sort_by":"<string>","term":"<string>","time":"<string>"}'
```
