# Meituan + Dianping Scraper (`edgy_dock/meituan-dianping-scraper`) Actor

Scrape Meituan and Dianping shops, deals and reviews.

- **URL**: https://apify.com/edgy\_dock/meituan-dianping-scraper.md
- **Developed by:** [wangyan](https://apify.com/edgy_dock) (community)
- **Categories:** E-commerce, Travel, Automation
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.005 / actor start

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## Meituan + Dianping Scraper — Shops, Deals & Reviews

Export data from Meituan (China's #1 local services platform) and Dianping (China's Yelp —
same company, shared database) as JSON, CSV or Excel. Search by keyword and city, pull full
shop details, collect group-buy deals (套餐) — without an API key, a Chinese business entity,
or a local agency.

Meituan serves **770M+ annual transacting users**. Together with Dianping it owns the Chinese
local-services discovery funnel — restaurants, beauty, karaoke, gyms, hotels, delivery. The
platform is almost completely closed to outsiders: no public API, cryptographically-signed
web endpoints, and official access requires a mainland Chinese business license. This Actor
is the data layer without any of that.

***

### Quick start (3 minutes)

1. **Grab a cookie** — open <https://www.meituan.com/> in your browser, solve any slider
   captcha, press `F12` → Console, run `copy(document.cookie)`.
2. **Click "Try for free"** at the top of this page (or paste the cookie into the `cookie`
   field of a run).
3. **Hit "Start"** — results appear in the Dataset tab within ~45 seconds.

Minimal input that works:

```json
{
  "searchKeywords": ["火锅"],
  "city": "北京",
  "cookie": "token=...; _lxsdk_cuid=...;",
  "maxItems": 20
}
```

***

### What you can do with it

| You are | You use it to |
|---|---|
| **A franchise brand** | Benchmark competitor shops in every target city — ratings, prices, deals, review counts |
| **A market researcher** | Map the entire supply side of a vertical (coffee shops in Shanghai, hotpot in Chengdu) |
| **A commercial real estate team** | Score foot-traffic indicators by neighbourhood using shop density + ratings |
| **A food / beverage buyer** | Find top-rated independent shops by category to source trends from |
| **A finance / M\&A team** | Due diligence on local chains — count of outlets, deal pricing, review velocity |

***

### Three ways to use it

#### 1 · Search by keyword in a city

```json
{
  "searchKeywords": ["火锅", "咖啡"],
  "city": "北京",
  "cookie": "...",
  "maxItems": 300,
  "sort": "most_sold",
  "fetchShopDetails": true,
  "maxDealsPerShop": 10
}
```

#### 2 · Deep-scrape specific shops

```json
{
  "shopUrls": [
    "https://www.meituan.com/meishi/12345678/"
  ],
  "city": "北京",
  "cookie": "...",
  "maxDealsPerShop": 50
}
```

#### 3 · Multi-city benchmark

```json
{
  "searchKeywords": ["海底捞"],
  "city": "上海",
  "cookie": "...",
  "maxItems": 50,
  "sort": "rating"
}
```

Rerun with `"city": "广州"`, `"city": "成都"`, etc. The `cityId` is included on every
output record so results from multiple runs merge cleanly.

***

### Input reference

| Field | Default | Notes |
|---|---|---|
| `searchKeywords` | `[]` | Chinese works — Pinyin / English rarely do |
| `city` | `"北京"` | Chinese city name or raw cityId. [Supported cities](#supported-cities) below |
| `shopUrls` | `[]` | `https://www.meituan.com/meishi/<shopId>/` |
| `cookie` | `""` | **Required in practice.** See [Cookie walkthrough](#cookie-walkthrough) |
| `maxItems` | `100` | Hard cap. You only pay for records actually delivered |
| `sort` | `default` | `default` / `distance` / `rating` / `most_sold` / `lowest_price` |
| `fetchShopDetails` | `false` | Open each shop for address, hours, categoryTree, photos |
| `maxDealsPerShop` | `0` | Set > 0 to also pull group-buy deals (套餐) |
| `proxyConfiguration` | `{useApifyProxy: true, apifyProxyGroups: ["RESIDENTIAL"]}` | **CN proxy strongly recommended** |

***

### Cookie walkthrough

```
1. Open https://www.meituan.com/ in Chrome / Edge / Firefox
2. If a slider captcha appears, solve it (otherwise the cookie is poisoned)
3. Press F12 → Developer Tools opens
4. Click the "Console" tab
5. Paste this and press Enter:
      copy(document.cookie)
6. Clipboard now holds the cookie string
7. Paste into the "cookie" field of the Actor input
```

The cookie looks like:

```
token=xxx; _lxsdk_cuid=xxx; _lxsdk_s=xxx; __mta=xxx; _hc.v=xxx; ...
```

You do **not** have to log in — Meituan serves anonymous users too — but logged-in cookies
return more results and survive longer. For Dianping shop pages, Dianping cookies work
interchangeably (same backend).

**Cookies decay fast.** Expect to refresh weekly, sometimes daily under heavy use.

***

### CN proxy — required in practice

Meituan blocks or captcha-walls most non-CN IPs. **The Actor usually returns nothing or hits
a slider wall without a CN residential proxy.**

```json
"proxyConfiguration": {
  "useApifyProxy": true,
  "apifyProxyGroups": ["RESIDENTIAL"],
  "apifyProxyCountry": "CN"
}
```

Bring-your-own:

```json
"proxyConfiguration": {
  "proxyUrls": ["http://user:pass@cn-proxy.example.com:8080"]
}
```

***

### Supported cities

Chinese city names resolved automatically to Meituan cityIds:

```
北京(1)   上海(10)   广州(20)   深圳(30)   杭州(50)   成都(59)   武汉(42)
南京(55)  西安(56)   重庆(45)   天津(40)   苏州(51)   青岛(61)   长沙(70)
郑州(71)  大连(83)   厦门(110)  宁波(54)   合肥(88)   济南(60)   沈阳(80)
昆明(160) 福州(101)  无锡(52)
```

For any other city, pass the raw numeric cityId as the `city` input value (e.g. `"city": "289"`).
Find cityIds by opening `meituan.com`, picking the city from the top-left city switcher, and
reading the `cityId` from the URL or page JS.

***

### Output

Each record is a flat JSON object. Chinese counts like `1.2w` / `3.4万` / `2亿` are normalised
to numbers.

#### Shop (from search)

```json
{
  "source": "search",
  "searchKeyword": "火锅",
  "searchCity": "北京",
  "shopId": "12345678",
  "name": "海底捞火锅 (国贸店)",
  "shopUrl": "https://www.meituan.com/meishi/12345678/",
  "address": "朝阳区建国路88号SOHO现代城",
  "phone": "010-12345678",
  "cityId": 1,
  "areaName": "国贸",
  "category": "火锅",
  "avgPrice": 128.0,
  "avgScore": 4.8,
  "allCommentNum": 12000,
  "latitude": 39.9,
  "longitude": 116.46,
  "imageUrl": "https://img.meituan.net/x.jpg",
  "dealsCount": 15,
  "lowestPrice": 69.0
}
```

#### Shop detail (with `fetchShopDetails: true`)

Adds `cityName`, `categoryTree[]`, `openTime`, `introduction`, `photos[]`.

#### Deal (套餐)

```json
{
  "source": "deal",
  "shopId": "12345678",
  "dealId": "999888777",
  "dealUrl": "https://www.meituan.com/deal/999888777.html",
  "title": "4人经典套餐",
  "subtitle": "周末可用 · 免预约",
  "price": 388.0,
  "originalPrice": 568.0,
  "soldCount": 15000,
  "imageUrl": "https://img.meituan.net/deal.jpg"
}
```

***

### Pricing

Pay-per-event — you are only charged for records actually delivered.

| Event | Price (USD) | What triggers it |
|---|---|---|
| `apify-actor-start` | $0.005 | Once per run (per GB RAM, min 1) |
| `poi-scraped` | $0.0015 | Each shop in search results |
| `shop-detail-scraped` | $0.004 | Each full shop profile |
| `deal-scraped` | $0.0004 | Each group-buy deal |

#### Cost estimator

| Job | Setting | Approx cost |
|---|---|---|
| City-wide hotpot survey | 200 shops in 北京 | **$0.31** |
| Full category sweep | 1 000 shops + full details + 10 deals each | **$9.50** |
| Multi-city brand audit | 50 shops × 10 cities | **$0.76** |
| Monthly tracker | 500 shops/day for 30 days | **$22.50 / month** |

Platform margin: Apify takes 20%, you keep 80%. Prices above are what you pay.

***

### Common errors

| Error / symptom | Cause | Fix |
|---|---|---|
| `No POIs captured for 'X'` | Captcha wall + no CN proxy | Enable CN residential proxy and re-copy cookie after solving the slider |
| Only a handful of shops when hundreds exist | Rate-limited by IP | Spread runs out, add bring-your-own proxy pool |
| Captcha page screenshots | IP burned | Switch Apify proxy group, wait 10 min |
| Wrong city results | City not in [list](#supported-cities) | Pass numeric cityId instead of name |
| `avgPrice` is 0 for many shops | Meituan hides price for certain categories | Expected — not every POI exposes price |
| Deals empty but shop exists | Shop has no group-buy deals right now | Expected — check `dealsCount` in the search record |

***

### Why this exists

Meituan's web APIs are signed with `_token` / `__mta` / `_lxsdk` headers derived from
obfuscated page JS that changes without notice. Re-implementing the signature is a losing
maintenance race.

Instead the Actor opens a real Chromium page in the Apify runtime, lets the page's own JS
make the real signed calls, and reads JSON off the wire. Meituan can rotate signatures all
they want — the browser catches up for us.

***

### Known limits

- **Cookies expire fast.** Users are expected to refresh their own cookie.
- **Slider captcha mid-run returns zero further records.** Rerun with a fresh cookie.
- **Dianping web is being merged into Meituan** — some endpoint paths shift without notice.
- **No proxy / non-CN proxy → mostly empty.**
- **Not every POI exposes `avgPrice` or `allCommentNum`;** defensive defaults kick in.
- **This is a scraper, not a CRM.** Data is read-only, best-effort.

***

### Changelog

- **0.1.1** · Initial public release

# Actor input Schema

## `searchKeywords` (type: `array`):

What to search for on Meituan — Chinese works best, e.g. 火锅, 咖啡, 美发, 台球. English rarely returns anything.

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

Chinese city name (北京, 上海, 广州...) or a raw Meituan cityId. Defaults to Beijing.

## `shopUrls` (type: `array`):

Individual Meituan shop URLs to scrape in full detail, e.g. https://www.meituan.com/meishi/12345678/

## `cookie` (type: `string`):

Required for reliable results. Open meituan.com or dianping.com in your browser (logged in or not), press F12 → Console → type document.cookie and paste here. See README.

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

Hard cap on records written. You are only charged for records actually delivered.

## `sort` (type: `string`):

How search results are ordered.

## `fetchShopDetails` (type: `boolean`):

Open every search hit to collect full address, hours, categoryTree, photos. Slower, more compute, richer records.

## `maxDealsPerShop` (type: `integer`):

Set above 0 to also collect group-buy deals (套餐) under each shop. Charged separately.

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

Meituan blocks or captcha-walls most non-CN IPs. A CN residential proxy is strongly recommended — the Actor will usually return nothing without one.

## Actor input object example

```json
{
  "searchKeywords": [
    "火锅",
    "咖啡",
    "美发"
  ],
  "city": "北京",
  "maxItems": 100,
  "sort": "default",
  "fetchShopDetails": false,
  "maxDealsPerShop": 0,
  "proxyConfiguration": {
    "useApifyProxy": true,
    "apifyProxyGroups": [
      "RESIDENTIAL"
    ]
  }
}
```

# Actor output Schema

## `datasetUrl` (type: `string`):

Browse the full scraped dataset in Apify Console.

# 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 = {
    "searchKeywords": [
        "火锅"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("edgy_dock/meituan-dianping-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 = { "searchKeywords": ["火锅"] }

# Run the Actor and wait for it to finish
run = client.actor("edgy_dock/meituan-dianping-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 '{
  "searchKeywords": [
    "火锅"
  ]
}' |
apify call edgy_dock/meituan-dianping-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,edgy_dock/meituan-dianping-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/eWNcRu590TTz8YHJZ/builds/qPfRnYm4VWZTmpyql/openapi.json
