# OpenTable Restaurant Search API Documentation

Search OpenTable by restaurant name, cuisine or keyword near a position. Each row has type (restaurant, cuisine or location), id, name, metro, area, neighborhood and coordinates. Restaurant rows carry the profile url and, for the first five, the rating, review count, price band, cuisine and street address. Costs 1 credit. Date, time and party size filters and table availability are not supported.

- **Documentation:** [https://scrappa.co/docs/opentable-api/opentable_search](https://scrappa.co/docs/opentable-api/opentable_search)
- **API group:** OpenTable API
- **Endpoint:** `GET https://scrappa.co/api/opentable/search`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `query` | string | Yes | Restaurant name, cuisine or keyword, 1 to 100 characters. Example: sushi. |
| `location` | string | No | Optional place name added to the search text, e.g. Chicago. It refines the text match. Use latitude and longitude to bias results to a position. |
| `latitude` | number | No | Latitude of the search centre. Send together with longitude. Defaults to New York. |
| `longitude` | number | No | Longitude of the search centre. Send together with latitude. |
| `type` | string | No | Only return rows of this type: restaurant, cuisine or location. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/opentable/search?query=mon+ami+gabi&latitude=41.88&longitude=-87.63&type=restaurant"
```

## Example response

```json
{
    "success": true,
    "data": {
        "query": "mon ami gabi",
        "results": [
            {
                "type": "restaurant",
                "id": "489",
                "name": "Mon Ami Gabi",
                "url": "https://www.opentable.com/restaurant/profile/489",
                "country": "United States",
                "metro": "Chicago / Illinois",
                "macro": "Chicago",
                "neighborhood": "Lincoln Park",
                "latitude": 41.924216,
                "longitude": -87.6370405,
                "rating": 4.8,
                "review_count": 763,
                "price_band": "$30 and under",
                "price_symbol": "$",
                "cuisine": "French",
                "address": "2300 N. Lincoln Park West",
                "city": "Chicago"
            }
        ]
    },
    "meta": {
        "endpoint_family": "search",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required query parameter is missing or invalid. This response is not billable. |
| 502 | Invalid Source Response | The upstream answered with a shape that no longer matches the documented contract. This response is not billable. |
| 503 | Service Unavailable | The upstream service is temporarily unavailable. Please retry shortly. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
