Browse documentation
GET

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

GET https://api.stayapi.com/v1/opentable/restaurant/url-to-id

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_idPositive numeric OpenTable restaurant ID.
nameRestaurant name returned by OpenTable.
countryCountry associated with the matched restaurant.
macroOpenTable's broader dining area, such as South West London.
neighborhoodOpenTable 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 →

Exact Availability

Check one restaurant, date, time, and party size.

View Documentation →
Request
curl -G "https://api.stayapi.com/v1/opentable/restaurant/url-to-id" \
  --data-urlencode "url=https://www.opentable.com/r/the-ivy-victoria-brasserie-london-2" \
  -H "X-API-Key: YOUR_API_KEY"
Response
{
  "success": true,
  "restaurant_id": 180654,
  "name": "The Ivy Victoria Brasserie",
  "country": "United Kingdom",
  "macro": "South West London",
  "neighborhood": "Victoria"
}