OpenTable URL to Restaurant ID API
Turn a full OpenTable /r/{slug} profile URL into the stable restaurant ID used by reviews and availability.
Overview
No browser session required
StayAPI extracts the complete restaurant slug, resolves its location, and matches it through OpenTable autocomplete. Callers do not run Chrome, Browserless, or a page scraper.
Use this endpoint when your input is an OpenTable restaurant URL instead of a numeric ID. The response also includes enough location context to verify the match before using restaurant_id with reviews, exact availability, or nearby slots.
Endpoint URL
Query Parameter
| Parameter | Type | Required | Description |
|---|---|---|---|
| url | string | Required | Full OpenTable restaurant profile URL in the form https://www.opentable.com/r/{slug}. Country domains such as opentable.fr and opentable.co.uk are supported. |
Response Fields
| Field | Description |
|---|---|
| restaurant_id | Positive numeric OpenTable restaurant ID. |
| name | Restaurant name returned by OpenTable. |
| country | Country associated with the matched restaurant. |
| macro | OpenTable's broader dining area, such as South West London. |
| neighborhood | OpenTable neighborhood when available. |
Keep the ID
Store restaurant_id after the first resolution. Future review and availability calls can use it directly without repeating the URL lookup.
Error Responses
Errors follow RFC 7807 Problem Details with provider: "opentable" and product: "url-to-id".
400 Invalid URL
INVALID_URL when the value is not a supported OpenTable restaurant profile URL.
404 Restaurant not found
RESTAURANT_NOT_FOUND when the slug resolves to no exact OpenTable restaurant match.
502 Upstream error
UPSTREAM_ERROR when location resolution or OpenTable autocomplete fails after retries.
Related Endpoints
Restaurant Reviews
Fetch newest, highest-rated, or lowest-rated reviews with the resolved ID.
View Documentation →