# Grubhub Restaurant Scraper — Ratings, Fees & Cuisines (`haketa/grubhub-scraper`) Actor

Scrape Grubhub restaurants by location: name, cuisines, rating & reviews, price level, delivery & service fees, delivery time, distance, phone and address. Enter ZIP codes, addresses or coordinates.

- **URL**: https://apify.com/haketa/grubhub-scraper.md
- **Developed by:** [Haketa](https://apify.com/haketa) (community)
- **Categories:** E-commerce, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Grubhub Restaurant Scraper — Ratings, Delivery Fees, Cuisines & Menus

> **Extract comprehensive restaurant data from [Grubhub](https://www.grubhub.com) across any US market — restaurant name, cuisine tags, star ratings, review volume, price tiers ($–$$$$), delivery fees, order minimums, delivery time estimates, distance, phone numbers, and full street addresses.** Search by ZIP code, full street address, city, or exact coordinates to scrape Grubhub into clean, structured data in seconds — **no coding, no login required**.

Export directly to **JSON, CSV, Excel, XML, HTML, or API**.

> Built for food-delivery analysts, restaurant-technology & POS vendors, logistics & courier startups, commercial real estate teams, competitive pricing analysts, and B2B sales teams building targeted restaurant merchant lead lists.

[![Grubhub Scraper](https://img.shields.io/badge/Grubhub-Restaurant%20Intelligence-f63440?style=for-the-badge\&logo=grubhub\&logoColor=white)]()
[![Ratings & Economics](https://img.shields.io/badge/Ratings%20%2B%20Fees%20%2B%20ETA-2da44e?style=for-the-badge\&logo=doordash\&logoColor=white)]()
[![Location Coverage](https://img.shields.io/badge/Coverage-All%20US%20Metros%20%26%20ZIPs-8250df?style=for-the-badge\&logo=google-maps\&logoColor=white)]()
[![Export Formats](https://img.shields.io/badge/Export-JSON%20%2F%20CSV%20%2F%20Excel-fb8500?style=for-the-badge\&logo=google-sheets\&logoColor=white)]()
[![Pagination](https://img.shields.io/badge/Pagination-1%2C000%2B%20Deep%20Extraction-00b4d8?style=for-the-badge\&logo=speedtest\&logoColor=white)]()
[![Maintenance](https://img.shields.io/badge/Maintained-Active%202026-brightgreen?style=for-the-badge)]()

***

### ⚡ At a glance

| Feature | Specification |
|---|---|
| **Data Targets** | Grubhub Restaurants, Food Delivery Listings & Merchant Profiles |
| **Input Flexibility** | ZIP codes (`10001`), street addresses, city names (`Austin, TX`), or `lat,lng` coordinates |
| **Fulfillment Modes** | Delivery and Pickup order methods |
| **Keyword Filtering** | Optional cuisine or restaurant brand search (e.g. `pizza`, `sushi`, `vegan`, `tacos`) |
| **Max Scale** | 1,000+ to 10,000+ restaurants per run with auto-pagination (`maxItemsPerLocation: 0`) |
| **Delivery Economics** | Exact delivery fee (in cents), delivery minimum order, service fees, ETA minutes |
| **Merchant Signals** | Direct phone number, complete address, price rating (1–4), operating open/closed status |
| **Geographic Data** | Street address, city, state/region, ZIP code, latitude, longitude, distance in miles |
| **Export Formats** | Dataset (JSON, CSV, Excel, XML, HTML) + Key-Value Store `OUTPUT` sync |
| **Proxy Requirement** | US Residential proxies (preconfigured and enabled by default) |
| **Execution Speed** | ~20 items per page; ~60 restaurants in under 15 seconds |

***

### 🔎 Why scrape Grubhub?

**Grubhub** is one of the leading food-delivery and takeout marketplaces in the United States, connecting millions of active diners with hundreds of thousands of independent restaurants and major franchise brands across every US state and postal code.

Each merchant profile on Grubhub represents rich, actionable commercial and logistics intelligence:

- Current delivery fees and order minimum thresholds.
- Average delivery transit time estimates and customer distance in miles.
- Customer sentiment scores, aggregate star ratings, and cumulative review counts.
- Categorical cuisine taxonomies and active promotional coupon availability.
- Verified operational phone numbers and physical kitchen addresses.

Collecting this intelligence manually or via basic page scrapers is fraught with operational challenges:

- Listings are dynamically rendered and localized to exact geo-coordinates.
- Delivery fees and minimums adjust dynamically based on diner proximity.
- High-volume data requests face strict IP challenge walls unless routed via residential networks.
- Manually compiling competitive intelligence across dozens of city districts is extremely slow and unscalable.

This **Grubhub Restaurant Scraper** automates the entire extraction pipeline. It resolves locations via automated geocoding, queries local restaurant inventories, and returns clean, typed data ready for analysis in Python, Excel, Google Sheets, or cloud data warehouses.

***

### 🎯 High-Impact Use Cases

#### 1. Delivery Economics & Pricing Benchmarking

Analyze delivery fees and minimum order requirements across neighborhoods and competing cuisines. Track how delivery surcharges change across peak dinner hours and weekend windows.

#### 2. Restaurant Tech & POS Sales Lead Generation

Arm sales development teams with pre-qualified merchant leads. Extract restaurant name, verified phone number, street address, and cuisine classification to pitch point-of-sale systems, kitchen automation hardware, loyalty platforms, or wholesale food distribution.

#### 3. Ghost Kitchen & Virtual Brand Site Selection

Evaluate commercial kitchen density and cuisine saturation before launching new physical or virtual restaurant concepts. Spot underserved cuisines (e.g. lack of authentic Mediterranean or vegan options in a high-density ZIP).

#### 4. Logistics & Courier Fleet Optimization

Model average delivery times (`deliveryTimeEstimate`) and service radiuses (`distanceMiles`) across urban versus suburban ZIP codes to optimize driver dispatching and delivery route planning.

#### 5. Franchise Competitive Intelligence & Territory Mapping

Monitor regional penetration for national chains (e.g. Shake Shack, Chipotle, Subway) and compare regional ratings against local independent competitors.

***

### ✨ Key Features & Capabilities

- ✅ **Location Agnostic Geocoding:** Pass any US location format — 5-digit ZIP codes (`90210`), city names (`Chicago, IL`), full street addresses, or decimal `latitude,longitude` coordinates.
- ✅ **Multi-Location Fan-Out:** Provide dozens of target postal codes or cities in a single run; each restaurant record retains its parent `searchLocation` for geographic attribution.
- ✅ **Deep 1,000+ Auto-Pagination:** Walks all available result pages sequentially without arbitrary cutoffs when `maxItemsPerLocation` is set to `0` (auto/unlimited governed by `maxItems`).
- ✅ **Automatic Restaurant De-duplication:** Automatically filters duplicate merchant IDs across overlapping location radiuses, ensuring 100% clean datasets.
- ✅ **Keyword & Cuisine Search:** Focus extraction on specific culinary segments (`"thai"`, `"gluten-free"`, `"burger"`) or scrape the full dining ecosystem.
- ✅ **Automatic Token Management:** Manages anonymous session authentication and token refresh in the background for zero-maintenance operation.
- ✅ **Dual-Storage Output:** Writes to Apify default dataset for bulk exports and updates Key-Value Store `OUTPUT` for rapid synchronous API calls.

***

### 📥 Input Parameters

All parameters are optional. Running the actor with empty `{}` inputs automatically defaults to New York, NY.

| Parameter | Type | Default | Description |
|---|---|---|---|
| `locations` | Array | `["New York, NY"]` | ZIP codes, street addresses, cities, or `"lat,lng"` coordinates. |
| `searchText` | String | `""` | Optional keyword to filter restaurants or cuisines (e.g. `"pizza"`, `"sushi"`). |
| `orderMethod` | String | `"delivery"` | Order fulfillment mode: `"delivery"` or `"pickup"`. |
| `maxItemsPerLocation` | Integer | `0` | Max restaurants per location. `0` = unlimited (governed by `maxItems`). |
| `maxItems` | Integer | `0` | Optional hard ceiling on total restaurants across all locations. `0` = unlimited. |
| `proxyConfiguration` | Object | `{ "useApifyProxy": true, ... }` | Proxy settings. US Residential proxies are required and enabled by default. |

#### Example Input Configuration

```json
{
  "locations": ["10001", "Austin, TX", "90210"],
  "searchText": "pizza",
  "orderMethod": "delivery",
  "maxItemsPerLocation": 0,
  "maxItems": 500,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": ["RESIDENTIAL"],
    "apifyProxyCountry": "US"
  }
}
```

***

### 📤 Output Data Structure

Each restaurant is returned as an individual flat record. Below is an authentic sample record:

```json
{
  "restaurantId": "2696190",
  "name": "DIG INN - Chelsea",
  "cuisines": [
    "American",
    "Gluten-Free",
    "Healthy",
    "Lunch Specials",
    "Vegan",
    "Vegetarian"
  ],
  "rating": 4.5,
  "ratingCount": 1358,
  "priceRating": 2,
  "street": "275 7th Ave",
  "city": "New York",
  "region": "NY",
  "postalCode": "10001",
  "latitude": 40.74556732,
  "longitude": -73.99416352,
  "distanceMiles": 0.2,
  "deliveryFee": 0,
  "serviceFee": null,
  "deliveryMinimum": 1500,
  "deliveryTimeEstimate": 25,
  "pickup": true,
  "delivery": true,
  "open": true,
  "phone": "6469055911",
  "couponsAvailable": false,
  "logo": "https://media-cdn.grubhub.com/image/upload/v1750794288/atcwanp7i9gdntoy7rlk.jpg",
  "url": "https://www.grubhub.com/restaurant/2696190",
  "searchLocation": "10001",
  "scrapedAt": "2026-11-10T14:42:15.820Z"
}
```

***

### 📊 Extracted Fields Reference

#### 🏷️ Restaurant Identity & Core Metadata

| Field Name | Type | Coverage | Description |
|---|---|---|---|
| `restaurantId` | String | 🟢 High (100%) | Grubhub's unique numeric merchant identifier. |
| `name` | String | 🟢 High (100%) | Official trading name of the restaurant. |
| `cuisines` | Array | 🟢 High (99%) | Array of cuisine categories (e.g. `["Italian", "Pizza"]`). |
| `url` | String | 🟢 High (100%) | Canonical storefront URL on Grubhub. |
| `logo` | String | 🟢 High (99%) | Direct URL to the restaurant's logo image. |
| `open` | Boolean | 🟢 High (100%) | Operating status indicating whether the kitchen is open. |
| `couponsAvailable` | Boolean | 🟢 High (100%) | `true` if active promotional discounts or promo codes exist. |

#### ⭐ Customer Ratings & Price Level

| Field Name | Type | Coverage | Description |
|---|---|---|---|
| `rating` | Float | 🟢 High (98%) | Aggregate customer rating score on a 0.0–5.0 star scale. |
| `ratingCount` | Integer | 🟢 High (98%) | Total cumulative customer review count. |
| `priceRating` | Integer | 🟢 High (95%) | Price tier indicator from 1 ($) to 4 ($$$$). |

#### 🛵 Delivery Economics & Fulfillment

| Field Name | Type | Coverage | Description |
|---|---|---|---|
| `deliveryFee` | Integer | 🟢 High (100%) | Base delivery fee in cents (`0` = Free Delivery; `399` = $3.99). |
| `deliveryMinimum` | Integer | 🟢 High (100%) | Minimum order value in cents (`1500` = $15.00 minimum). |
| `serviceFee` | Integer | 🟡 Conditional | Marketplace service fee in cents (where reported). |
| `deliveryTimeEstimate`| Integer| 🟢 High (95%) | Estimated delivery transit time in minutes. |
| `delivery` | Boolean | 🟢 High (100%) | `true` if delivery fulfillment is available. |
| `pickup` | Boolean | 🟢 High (100%) | `true` if diner pickup / takeout is supported. |

#### 📍 Location, Contact & Provenance

| Field Name | Type | Coverage | Description |
|---|---|---|---|
| `street` | String | 🟢 High (99%) | Physical street address of the restaurant. |
| `city` | String | 🟢 High (100%) | Municipality or city name. |
| `region` | String | 🟢 High (100%) | Two-letter US state code (e.g. `NY`, `CA`, `TX`). |
| `postalCode` | String | 🟢 High (100%) | 5-digit US ZIP postal code. |
| `latitude` | Float | 🟢 High (100%) | Latitude coordinate in decimal degrees. |
| `longitude` | Float | 🟢 High (100%) | Longitude coordinate in decimal degrees. |
| `distanceMiles` | Float | 🟢 High (100%) | Calculated distance in miles from the queried address. |
| `phone` | String | 🟢 High (95%) | Direct restaurant telephone number. |
| `searchLocation` | String | 🟢 High (100%) | Target query location originating the record. |
| `scrapedAt` | String | 🟢 High (100%) | Extraction timestamp in ISO 8601 format. |

***

### 🔁 Deep 1,000+ Pagination & Multi-Location Scaling

This scraper is engineered for high-volume commercial intelligence:

- **Automatic Multi-Page Traversal:** Advances page by page (20 items per request) reading total available pages dynamically.
- **Uncapped Deep Extraction:** When `maxItemsPerLocation: 0`, the scraper runs continuously until all merchant inventory matching your query is gathered.
- **De-duplication per Query Radius:** Avoids duplicate rows when multiple nearby ZIP codes share overlapping restaurant delivery radiuses.
- **Multi-Location Fan-Out:** Input multiple ZIP codes to cover entire metropolitan statistical areas (MSAs) in a single run.

***

### 💻 Programmatic Integration & SDK Usage

Run this actor programmatically via Python, Node.js, or cURL to automate merchant data collection.

#### Python SDK Example

```python
from apify_client import ApifyClient
import pandas as pd

client = ApifyClient("YOUR_APIFY_TOKEN")

run_input = {
    "locations": ["Austin, TX", "78701"],
    "searchText": "tacos",
    "maxItems": 200,
    "maxItemsPerLocation": 0
}

## Run actor and wait for completion
run = client.actor("haketa/grubhub-scraper").call(run_input=run_input)

## Fetch dataset items and load into Pandas DataFrame
items = list(client.dataset(run["defaultDatasetId"]).iterate_items())
df = pd.DataFrame(items)

print(f"Extracted {len(df)} restaurants.")
## Convert fees from cents to dollars
df["deliveryFeeUSD"] = df["deliveryFee"] / 100
top_rated = df.sort_values(by="rating", ascending=False)[["name", "rating", "deliveryFeeUSD", "phone"]]
print(top_rated.head(10))
```

#### Node.js Example

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: 'YOUR_APIFY_TOKEN' });

const run = await client.actor('haketa/grubhub-scraper').call({
    locations: ['Miami, FL'],
    searchText: 'seafood',
    maxItems: 150,
    maxItemsPerLocation: 0
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(`Extracted ${items.length} seafood restaurants.`);
```

#### cURL API Example

```bash
curl -X POST "https://api.apify.com/v2/acts/haketa~grubhub-scraper/runs?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "locations": ["New York, NY"],
    "maxItems": 60
  }'
```

***

### 📋 Comprehensive Format Comparison

| Export Format | Recommended Use Case | Characteristics |
|---|---|---|
| **JSON** | Custom backend integration, AI/LLM models, API pipelines | Preserves array types for `cuisines`, exact float coordinates, and booleans. |
| **CSV** | Spreadsheet analysis in Excel or Google Sheets | Flattened tabular structure ready for pivot tables and columnar filtering. |
| **Excel (.xlsx)** | Stakeholder reports, executive presentations, offline review | Formatted workbook with auto-fitted columns and headers. |
| **XML / HTML** | Legacy system ingestion, web publishing | Hierarchical XML markup representation of restaurant records. |

***

### 🔄 Workflow Automation & Export Pipelines

Streamline intelligence delivery into your existing toolstack:

- **Google Sheets Automated Lead Sync:** Connect run results to Google Sheets via Apify integrations to feed merchant sales reps fresh restaurant phone numbers weekly.
- **Tableau & Power BI Analysis:** Ingest structured CSV outputs to visualize delivery fee distributions across urban zip codes.
- **Airbyte & Snowflake Warehousing:** Pipe restaurant catalog data directly into your cloud data warehouse for unified market share tracking.
- **Slack Alerting:** Trigger webhook notifications whenever new competitor restaurants open in your designated franchise territories.

***

### 💡 Practical Pro-Tips

1. **Interpreting Monetary Fees:** Remember that `deliveryFee` and `deliveryMinimum` are integer values represented in **cents**. Divide by 100 to obtain dollar figures (e.g. `299` = $2.99).

2. **Treat Zero Fees as Free Delivery:** A value of `deliveryFee: 0` signifies free delivery promotions — a powerful competitive marketing indicator.

3. **Pinpoint Precision with Coordinates:** While city names and ZIP codes work seamlessly, supplying decimal `"lat,lng"` coordinates pins the search to exact street intersections.

4. **Targeted Cuisine Sweeps:** Use `searchText: "thai"` or `searchText: "vegan"` to extract complete sector slices without scraping unrelated cuisines.

5. **Keep US Residential Proxies On:** Grubhub enforces strict residential IP verification; leaving the default residential proxy setting active guarantees maximum uptime.

6. **Comparing Pickup vs. Delivery Density:** Run identical locations twice — once with `orderMethod: "delivery"` and once with `orderMethod: "pickup"` — to analyze merchant fulfillment preferences.

7. **Phone Lead Verification:** The `phone` field provides standardized 10-digit US telephone numbers ready for CRM auto-dialers and outreach campaigns.

***

### ❓ Frequently Asked Questions

##### Do I need a Grubhub account or API key?

No. All listings are publicly visible restaurant records. No account, API key, or authentication token is required.

##### What happens if I pass an empty input `{}`?

The scraper defaults to extracting restaurants from New York, NY with standard prefill limits, ensuring you always receive valid results without early exits.

##### Why are fees represented as large integers?

Grubhub's internal architecture records currency amounts in cents to eliminate floating-point rounding errors. Divide by 100 in your analysis to convert to standard USD dollars.

##### Does this scraper extract dish menus and individual food prices?

No. This actor extracts listing-level merchant data: ratings, cuisines, contact details, coordinates, and delivery economics. It does not scrape granular itemized dish menus.

##### How are promotional coupons and discounts flagged?

The `couponsAvailable` boolean indicates whether Grubhub has active merchant-sponsored promotions or coupon codes displayed on the storefront.

##### Can I filter by minimum restaurant rating or review count?

You can filter extracted records directly in the Apify dataset viewer or post-process your CSV/JSON export to isolate listings where `rating >= 4.5` and `ratingCount >= 500`.

##### Can I search multiple ZIP codes simultaneously?

Yes. Simply supply multiple postal codes or addresses in the `locations` array. The scraper will geocode and query each location sequentially, deduplicating overlapping results.

##### What export formats are supported?

You can download your dataset in JSON, CSV, Excel (.xlsx), HTML, XML, or access records directly via the Apify REST API.

***

### 📋 Changelog

#### Version 1.2 (2026-11)

- **Deep 1,000+ Pagination Unlocked:** Updated `maxItemsPerLocation` default to `0` (auto/unlimited governed by `maxItems`), enabling continuous multi-page pagination across large metropolitan markets.
- **Zero-Input Fallback Guarantee:** Added default location fallback (`New York, NY`) when running with empty `{}` inputs, ensuring valid results without early terminations.
- **Fast Prefill Optimization:** Streamlined prefill run defaults to complete 60+ restaurant extractions in under 12–18 seconds.
- **Store Schema Compliance:** Fully validated input, output, and dataset specifications against Apify Specification v1.

#### Version 1.1 (2026-10)

- Added automatic Nominatim OSM geocoding for ZIP codes, addresses, and cities.
- Implemented automatic token bootstrapping and dynamic client_id resolution.
- Introduced restaurant de-duplication across multi-location queries.

#### Version 1.0 (2026-09)

- Initial release featuring restaurant, ratings, delivery fee, and cuisine extraction by location.

# Changelog

This Actor's version history is a separate document: https://apify.com/haketa/grubhub-scraper/changelog.md

# Actor input Schema

## `locations` (type: `array`):

ZIP codes, addresses, cities, or "lat,lng" coordinates (e.g. "10001", "New York, NY", "40.7484,-73.9857"). Each is searched separately.

## `searchText` (type: `string`):

Optional keyword to filter restaurants or cuisines (e.g. "pizza", "sushi", "vegan"). Leave empty for all restaurants.

## `orderMethod` (type: `string`):

delivery or pickup.

## `maxItemsPerLocation` (type: `integer`):

Maximum restaurants to collect per location. 0 = auto/unlimited (governed by Max total restaurants).

## `maxItems` (type: `integer`):

Optional hard cap on total restaurants across all locations. 0 = no limit.

## `proxyConfiguration` (type: `object`):

Grubhub requires a US residential proxy (datacenter IPs are blocked by anti-bot) — residential is enabled by default.

## Actor input object example

```json
{
  "locations": [
    "New York, NY"
  ],
  "orderMethod": "delivery",
  "maxItemsPerLocation": 0,
  "maxItems": 60,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}
```

# Actor output Schema

## `restaurantId` (type: `string`):

Grubhub restaurant ID

## `name` (type: `string`):

Restaurant name

## `cuisines` (type: `string`):

Cuisine tags

## `rating` (type: `string`):

Star rating

## `ratingCount` (type: `string`):

Number of ratings

## `priceRating` (type: `string`):

Price level 1-4 ($-$$$$)

## `street` (type: `string`):

Street address

## `city` (type: `string`):

City

## `region` (type: `string`):

State/region

## `postalCode` (type: `string`):

Postal code

## `latitude` (type: `string`):

Restaurant latitude

## `longitude` (type: `string`):

Restaurant longitude

## `distanceMiles` (type: `string`):

Distance from location

## `deliveryFee` (type: `string`):

Delivery fee

## `serviceFee` (type: `string`):

Service fee

## `deliveryMinimum` (type: `string`):

Delivery minimum

## `deliveryTimeEstimate` (type: `string`):

Delivery time estimate

## `pickup` (type: `string`):

Offers pickup

## `delivery` (type: `string`):

Offers delivery

## `open` (type: `string`):

Currently open

## `phone` (type: `string`):

Phone number

## `couponsAvailable` (type: `string`):

Coupons available

## `logo` (type: `string`):

Restaurant logo image URL

## `url` (type: `string`):

Restaurant URL

## `searchLocation` (type: `string`):

Input location searched

## `scrapedAt` (type: `string`):

ISO timestamp

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "locations": [
        "New York, NY"
    ],
    "orderMethod": "delivery",
    "maxItemsPerLocation": 0,
    "maxItems": 60,
    "proxyConfiguration": {
        "useApifyProxy": true,
        "apifyProxyGroups": [
            "RESIDENTIAL"
        ],
        "apifyProxyCountry": "US"
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("haketa/grubhub-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "locations": ["New York, NY"],
    "orderMethod": "delivery",
    "maxItemsPerLocation": 0,
    "maxItems": 60,
    "proxyConfiguration": {
        "useApifyProxy": True,
        "apifyProxyGroups": ["RESIDENTIAL"],
        "apifyProxyCountry": "US",
    },
}

# Run the Actor and wait for it to finish
run = client.actor("haketa/grubhub-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "locations": [
    "New York, NY"
  ],
  "orderMethod": "delivery",
  "maxItemsPerLocation": 0,
  "maxItems": 60,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ],
    "apifyProxyCountry": "US"
  }
}' |
apify call haketa/grubhub-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,haketa/grubhub-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/gXSwgWI6e8wsJJeuf/builds/YCun83r7bi3ARSQKx/openapi.json
