Scrape OpenTable restaurants
Search OpenTable for restaurants and extract names, ratings, cuisines, and price ranges from the results.
- A Browserless API token from your account dashboard
Steps
OpenTable renders its search results with JavaScript and uses bot-detection measures, so a plain HTTP request won't return listing data. The examples below search for Italian restaurants and route through stealth mode with a residential proxy.
OpenTable updates its markup periodically. If selectors stop returning results, inspect the live page with browser DevTools to find the current element and attribute names.
- AI Agent
- REST API
- Frameworks
- BQL
Use the Browserless MCP server to scrape restaurant listings from OpenTable from any MCP-compatible AI agent (Claude Desktop, Cursor, Windsurf, ChatGPT, etc.).
1. Connect the MCP server
Send this prompt to your AI agent to install the Browserless MCP server:
Go to https://github.com/browserless/browserless-mcp/blob/main/install.md
and follow the instructions to install the Browserless MCP server
for my client.
2. Scrape OpenTable
Use browserless_smartscraper. It handles OpenTable's dynamic content and bot protection automatically.
Use the browserless_smartscraper tool to scrape restaurant listings
from https://www.opentable.com/s?term=italian&covers=2
and return the results as markdown
Send the BQL mutation over HTTP to the stealth endpoint. No browser library or BQL IDE required.
- cURL
- JavaScript
- Python
- Java
- C#
1. Send the request
curl -X POST \
"https://production-sfo.browserless.io/stealth/bql?token=YOUR_API_TOKEN_HERE&proxy=residential&proxyCountry=us" \
-H "Content-Type: application/json" \
-d '{
"query": "mutation ScrapeOpenTable { goto(url: \"https://www.opentable.com/s?term=italian&covers=2\", waitUntil: domContentLoaded) { status } waitForSelector(selector: \"[data-test=restaurant-card]:has(h6)\", timeout: 15000) { time } restaurants: mapSelector(selector: \"[data-test=restaurant-card]:has(h6)\") { name: mapSelector(selector: \"h6\") { innerText } summary: mapSelector(selector: \"[data-testid=search-list-card-content-container] > div:nth-child(2)\") { innerText } cuisine: mapSelector(selector: \"[aria-label^=Price] + span\") { innerText } priceRange: mapSelector(selector: \"[aria-label^=Price]\") { innerText } bookingsToday: mapSelector(selector: \"[data-testid=icSocialProof] + span\") { innerText } } }",
"variables": {}
}'
2. Check the output
{
"data": {
"goto": { "status": 200 },
"waitForSelector": { "time": 3412 },
"restaurants": [
{
"name": [{ "innerText": "Carbone" }],
"summary": [{ "innerText": "4.8 (2,914) • $$$$ • Italian • Greenwich Village" }],
"cuisine": [{ "innerText": "Italian" }],
"priceRange": [{ "innerText": "$$$$" }],
"bookingsToday": [{ "innerText": "Booked 42 times today" }]
},
{
"name": [{ "innerText": "L'Artusi" }],
"summary": [{ "innerText": "4.7 (5,106) • $$$ • Italian • West Village" }],
"cuisine": [{ "innerText": "Italian" }],
"priceRange": [{ "innerText": "$$$" }],
"bookingsToday": [{ "innerText": "Booked 28 times today" }]
}
]
}
}
1. Send the request
const query = `mutation ScrapeOpenTable {
goto(url: "https://www.opentable.com/s?term=italian&covers=2", waitUntil: domContentLoaded) {
status
}
waitForSelector(selector: "[data-test=restaurant-card]:has(h6)", timeout: 15000) {
time
}
restaurants: mapSelector(selector: "[data-test=restaurant-card]:has(h6)") {
name: mapSelector(selector: "h6") { innerText }
summary: mapSelector(selector: "[data-testid=search-list-card-content-container] > div:nth-child(2)") { innerText }
cuisine: mapSelector(selector: "[aria-label^=Price] + span") { innerText }
priceRange: mapSelector(selector: "[aria-label^=Price]") { innerText }
bookingsToday: mapSelector(selector: "[data-testid=icSocialProof] + span") { innerText }
}
}`;
const response = await fetch(
'https://production-sfo.browserless.io/stealth/bql?token=YOUR_API_TOKEN_HERE&proxy=residential&proxyCountry=us',
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ query, variables: {} }),
}
);
const { data } = await response.json();
console.log(JSON.stringify(data.restaurants, null, 2));
2. Check the output
[
{
"name": [{ "innerText": "Carbone" }],
"summary": [{ "innerText": "4.8 (2,914) • $$$$ • Italian • Greenwich Village" }],
"cuisine": [{ "innerText": "Italian" }],
"priceRange": [{ "innerText": "$$$$" }],
"bookingsToday": [{ "innerText": "Booked 42 times today" }]
},
{
"name": [{ "innerText": "L'Artusi" }],
"summary": [{ "innerText": "4.7 (5,106) • $$$ • Italian • West Village" }],
"cuisine": [{ "innerText": "Italian" }],
"priceRange": [{ "innerText": "$$$" }],
"bookingsToday": [{ "innerText": "Booked 28 times today" }]
}
]
1. Install dependencies
pip install requests
2. Send the request
import requests
query = """
mutation ScrapeOpenTable {
goto(url: "https://www.opentable.com/s?term=italian&covers=2", waitUntil: domContentLoaded) {
status
}
waitForSelector(selector: "[data-test=restaurant-card]:has(h6)", timeout: 15000) {
time
}
restaurants: mapSelector(selector: "[data-test=restaurant-card]:has(h6)") {
name: mapSelector(selector: "h6") { innerText }
summary: mapSelector(selector: "[data-testid=search-list-card-content-container] > div:nth-child(2)") { innerText }
cuisine: mapSelector(selector: "[aria-label^=Price] + span") { innerText }
priceRange: mapSelector(selector: "[aria-label^=Price]") { innerText }
bookingsToday: mapSelector(selector: "[data-testid=icSocialProof] + span") { innerText }
}
}
"""
response = requests.post(
'https://production-sfo.browserless.io/stealth/bql',
params={
'token': 'YOUR_API_TOKEN_HERE',
'proxy': 'residential',
'proxyCountry': 'us',
},
json={'query': query, 'variables': {}},
)
data = response.json()['data']
for r in data['restaurants']:
name = r['name'][0]['innerText']
# The summary line reads "4.8 (1,573) • $$ • Italian • <neighborhood>".
rating = r['summary'][0]['innerText'].strip().split(' ')[0]
cuisine = r['cuisine'][0]['innerText']
price = r['priceRange'][0]['innerText']
print(f'{name} | {rating} stars | {cuisine} | {price}')
3. Check the output
Carbone | 4.8 stars | Italian | $$$$
L'Artusi | 4.7 stars | Italian | $$$
1. Send the request
import java.net.URI;
import java.net.http.*;
public class ScrapeOpenTable {
public static void main(String[] args) throws Exception {
String token = "YOUR_API_TOKEN_HERE";
String endpoint = "https://production-sfo.browserless.io/stealth/bql?token=" + token
+ "&proxy=residential&proxyCountry=us";
String query = "mutation ScrapeOpenTable {"
+ " goto(url: \\\"https://www.opentable.com/s?term=italian&covers=2\\\", waitUntil: domContentLoaded) { status }"
+ " waitForSelector(selector: \\\"[data-test=restaurant-card]:has(h6)\\\", timeout: 15000) { time }"
+ " restaurants: mapSelector(selector: \\\"[data-test=restaurant-card]:has(h6)\\\") {"
+ " name: mapSelector(selector: \\\"h6\\\") { innerText }"
+ " summary: mapSelector(selector: \\\"[data-testid=search-list-card-content-container] > div:nth-child(2)\\\") { innerText }"
+ " cuisine: mapSelector(selector: \\\"[aria-label^=Price] + span\\\") { innerText }"
+ " priceRange: mapSelector(selector: \\\"[aria-label^=Price]\\\") { innerText }"
+ " bookingsToday: mapSelector(selector: \\\"[data-testid=icSocialProof] + span\\\") { innerText }"
+ " }"
+ " }";
String payload = "{\"query\": \"" + query + "\", \"variables\": {}}";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(endpoint))
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
2. Check the output
{
"data": {
"goto": { "status": 200 },
"waitForSelector": { "time": 3412 },
"restaurants": [
{
"name": [{ "innerText": "Carbone" }],
"summary": [{ "innerText": "4.8 (2,914) • $$$$ • Italian • Greenwich Village" }],
"cuisine": [{ "innerText": "Italian" }],
"priceRange": [{ "innerText": "$$$$" }],
"bookingsToday": [{ "innerText": "Booked 42 times today" }]
}
]
}
}
1. Send the request
using System.Net.Http;
using System.Text;
using System.Text.Json;
string token = "YOUR_API_TOKEN_HERE";
string endpoint = $"https://production-sfo.browserless.io/stealth/bql?token={token}&proxy=residential&proxyCountry=us";
var payload = new
{
query = @"mutation ScrapeOpenTable {
goto(url: ""https://www.opentable.com/s?term=italian&covers=2"", waitUntil: domContentLoaded) { status }
waitForSelector(selector: ""[data-test=restaurant-card]:has(h6)"", timeout: 15000) { time }
restaurants: mapSelector(selector: ""[data-test=restaurant-card]:has(h6)"") {
name: mapSelector(selector: ""h6"") { innerText }
summary: mapSelector(selector: ""[data-testid=search-list-card-content-container] > div:nth-child(2)"") { innerText }
cuisine: mapSelector(selector: ""[aria-label^=Price] + span"") { innerText }
priceRange: mapSelector(selector: ""[aria-label^=Price]"") { innerText }
bookingsToday: mapSelector(selector: ""[data-testid=icSocialProof] + span"") { innerText }
}
}",
variables = new { },
};
using (HttpClient httpClient = new HttpClient())
{
var content = new StringContent(
JsonSerializer.Serialize(payload), Encoding.UTF8, "application/json");
var response = await httpClient.PostAsync(endpoint, content);
string body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
2. Check the output
{
"data": {
"goto": { "status": 200 },
"waitForSelector": { "time": 3412 },
"restaurants": [
{
"name": [{ "innerText": "Carbone" }],
"summary": [{ "innerText": "4.8 (2,914) • $$$$ • Italian • Greenwich Village" }],
"cuisine": [{ "innerText": "Italian" }],
"priceRange": [{ "innerText": "$$$$" }],
"bookingsToday": [{ "innerText": "Booked 42 times today" }]
}
]
}
}
Connect through stealth mode and a residential proxy so OpenTable sees traffic from a real browser, then extract restaurant data from the rendered page.
- Puppeteer
- Playwright
1. Install dependencies
npm install puppeteer-core
2. Connect and scrape
import puppeteer from 'puppeteer-core';
const browser = await puppeteer.connect({
browserWSEndpoint:
'wss://production-sfo.browserless.io/stealth?token=YOUR_API_TOKEN_HERE&proxy=residential&proxyCountry=us',
});
try {
const page = await browser.newPage();
await page.goto('https://www.opentable.com/s?term=italian&covers=2', {
waitUntil: 'domcontentloaded',
timeout: 60000,
});
// Results render client-side a few seconds after the DOM loads.
await page.waitForSelector('[data-test="restaurant-card"]:has(h6)', { timeout: 60000 });
const restaurants = await page.evaluate(() =>
Array.from(document.querySelectorAll('[data-test="restaurant-card"]:has(h6)')).map((card) => ({
name: card.querySelector('h6')?.innerText?.trim() ?? '',
// The summary line reads "4.8 (1,573) • $$ • Italian • <neighborhood>".
rating: card.querySelector('[data-testid="search-list-card-content-container"] > div:nth-child(2)')
?.innerText?.trim().split(' ')[0] ?? '',
cuisine: card.querySelector('[aria-label^="Price"] + span')?.innerText?.trim() ?? '',
priceRange: card.querySelector('[aria-label^="Price"]')?.innerText?.trim() ?? '',
}))
);
console.log(JSON.stringify(restaurants, null, 2));
} finally {
await browser.close();
}
3. Check the output
Run with node scrape-opentable.mjs. Each object has name, rating, cuisine, and priceRange fields.
[
{
"name": "Carbone",
"rating": "4.8",
"cuisine": "Italian",
"priceRange": "$$$$"
},
{
"name": "L'Artusi",
"rating": "4.7",
"cuisine": "Italian",
"priceRange": "$$$"
}
]
1. Install dependencies
npm install playwright-core
2. Connect and scrape
import { chromium } from 'playwright-core';
const browser = await chromium.connectOverCDP(
'wss://production-sfo.browserless.io/stealth?token=YOUR_API_TOKEN_HERE&proxy=residential&proxyCountry=us'
);
try {
const context = browser.contexts()[0];
const page = await context.newPage();
await page.goto('https://www.opentable.com/s?term=italian&covers=2', {
waitUntil: 'domcontentloaded',
timeout: 60000,
});
// Results render client-side a few seconds after the DOM loads.
await page.waitForSelector('[data-test="restaurant-card"]:has(h6)', { timeout: 60000 });
const restaurants = await page.evaluate(() =>
Array.from(document.querySelectorAll('[data-test="restaurant-card"]:has(h6)')).map((card) => ({
name: card.querySelector('h6')?.innerText?.trim() ?? '',
// The summary line reads "4.8 (1,573) • $$ • Italian • <neighborhood>".
rating: card.querySelector('[data-testid="search-list-card-content-container"] > div:nth-child(2)')
?.innerText?.trim().split(' ')[0] ?? '',
cuisine: card.querySelector('[aria-label^="Price"] + span')?.innerText?.trim() ?? '',
priceRange: card.querySelector('[aria-label^="Price"]')?.innerText?.trim() ?? '',
}))
);
console.log(JSON.stringify(restaurants, null, 2));
} finally {
await browser.close();
}
3. Check the output
Run with node scrape-opentable.mjs. Each object has name, rating, cuisine, and priceRange fields.
[
{
"name": "Carbone",
"rating": "4.8",
"cuisine": "Italian",
"priceRange": "$$$$"
},
{
"name": "L'Artusi",
"rating": "4.7",
"cuisine": "Italian",
"priceRange": "$$$"
}
]
1. Write the mutation
Navigate to OpenTable's search results, wait for restaurant cards to render, then extract structured data from each listing. We use /stealth/bql because OpenTable's bot detection blocks plain browser sessions.
mutation ScrapeOpenTable {
goto(url: "https://www.opentable.com/s?term=italian&covers=2", waitUntil: domContentLoaded) {
status
}
waitForSelector(selector: "[data-test=restaurant-card]:has(h6)", timeout: 15000) {
time
}
restaurants: mapSelector(selector: "[data-test=restaurant-card]:has(h6)") {
name: mapSelector(selector: "h6") { innerText }
summary: mapSelector(selector: "[data-testid=search-list-card-content-container] > div:nth-child(2)") { innerText }
cuisine: mapSelector(selector: "[aria-label^=Price] + span") { innerText }
priceRange: mapSelector(selector: "[aria-label^=Price]") { innerText }
bookingsToday: mapSelector(selector: "[data-testid=icSocialProof] + span") { innerText }
}
}
2. Run it
Paste into the BQL IDE and click Run.
3. Check the output
{
"data": {
"goto": { "status": 200 },
"waitForSelector": { "time": 3412 },
"restaurants": [
{
"name": [{ "innerText": "Carbone" }],
"summary": [{ "innerText": "4.8 (2,914) • $$$$ • Italian • Greenwich Village" }],
"cuisine": [{ "innerText": "Italian" }],
"priceRange": [{ "innerText": "$$$$" }],
"bookingsToday": [{ "innerText": "Booked 42 times today" }]
},
{
"name": [{ "innerText": "L'Artusi" }],
"summary": [{ "innerText": "4.7 (5,106) • $$$ • Italian • West Village" }],
"cuisine": [{ "innerText": "Italian" }],
"priceRange": [{ "innerText": "$$$" }],
"bookingsToday": [{ "innerText": "Booked 28 times today" }]
}
]
}
}