返回顶部
d

dianping-api大众点评API

Dianping (大众点评) API skill for searching restaurants and businesses, viewing shop details, deals/coupons, and reading recommended dishes. Use this skill when: (1) the user asks about restaurants, food, or local businesses in Chinese cities, (2) the user wants to search dianping.com, (3) the user needs shop ratings, reviews, prices, deals, or addresses from 大众点评, (4) any query involving Chinese dining recommendations or local business lookup.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
264
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

dianping-api

大众点评API

零依赖的HTTP API,用于访问大众点评。无需浏览器引擎,无需pip安装——只需curl(macOS/Linux系统自带)。

前置条件

  • - Python 3.6+
  • curl(系统自带,无需安装)

身份验证(仅需2个Cookie)

仅需dper和dplet两个Cookie。存储在~/.dianping/cookies.json中。

bash

设置Cookie


python3 dianping-api/scripts/dianping_login.py --set-cookies dper=xxx; dplet=yyy

检查登录状态

python3 dianping-api/scripts/dianping_login.py --status

Cookie过期?引导式续期:

python3 dianping-api/scripts/dianping_login.py --renew

API参考 — dianping_api.py

所有命令输出JSON到标准输出,便于AI解析。

1. 搜索店铺

bash
python3 dianping-api/scripts/dianpingapi.py search <关键词> [--cityid N]

  • - 关键词:大众点评搜索框,支持自由组合。示例:
- 菜系:川菜、日料、淮扬菜、火锅、西餐 - 地点+菜系:外滩 日料、陆家嘴 火锅、世纪大道 淮扬菜 - 景点+场景:迪士尼 亲子餐厅、故宫 烤鸭、西湖 本帮菜 - 特殊需求:有包厢、宝宝餐、人均100、深夜食堂 - 综合:陆家嘴 亲子 好评、南京路 网红甜品
  • - city_id:城市编号(见下方城市表),默认1=上海

响应:
json
{
keyword: 世纪大道淮扬菜,
city_id: 1,
count: 11,
shops: [
{
shop_id: l7UgWvw6yZ7ytaly,
name: 九厨·淮扬(陆家嘴紫金山店),
rating: 4.5,
review_count: 455,
avg_price: 155
}
]
}

2. 店铺详情

bash
python3 dianping-api/scripts/dianpingapi.py shop id>

响应:
json
{
shop_id: l7UgWvw6yZ7ytaly,
name: 九厨·淮扬(陆家嘴紫金山店),
score_text: 口味:4.7 环境:4.8 服务:4.7,
avg_price: 155,
review_count: 455条,
category: 淮扬菜,
region: 世纪大道,
address: 东方路778号金陵紫金山大酒店2楼,
route: 距地铁世纪大道站12口步行400m,
phone: 65,
recommended_dishes: [九厨桂花香酥烤鸭, 淮安特色一品狮子头, ...],
scores: {taste: 4.7, environment: 4.8, service: 4.7}
}

3. 优惠/团购

bash
python3 dianping-api/scripts/dianpingapi.py deals id>

响应:
json
{
shop_id: l7UgWvw6yZ7ytaly,
name: 九厨·淮扬(陆家嘴紫金山店),
deals: [
{title: 【午市专享】100元代金券, price: 79.0, original_price: 100.0},
{title: 九厨淮扬精选宝宝餐, price: 0.1, original_price: 29.9},
{title: 招牌烤鸭+醉沼虾+牛肉粒2-3人餐, price: 279.0, original_price: 500.0}
],
services: [],
tags: []
}

Python导入使用

python
import sys; sys.path.insert(0, dianping-api/scripts)
from dianpingapi import apisearch, apishop, apideals

搜索

results = apisearch(陆家嘴火锅, cityid=1) for s in results[shops]: print(s[shop_id], s[name], s.get(rating))

店铺详情

info = api_shop(l7UgWvw6yZ7ytaly) print(info[scores], info[recommended_dishes])

优惠

deals = api_deals(l7UgWvw6yZ7ytaly) for d in deals[deals]: print(d[title], d.get(price), d.get(original_price))

典型AI工作流程

  1. 1. 根据用户意图组合关键词(地点+菜系+场景),选对city_id
例:用户说北京故宫附近吃烤鸭 → search(故宫 烤鸭, city_id=2) 例:用户说上海迪士尼带娃吃饭 → search(迪士尼 亲子餐厅, city_id=1) 例:用户说杭州西湖附近日料 → search(西湖 日料, city_id=5)
  1. 2. apisearch(keyword, cityid) → 获取shopid列表
  2. apishop(shopid) → 评分、推荐菜、地址、交通
  3. apideals(shop_id) → 优惠券、套餐、价格
  4. 整理推荐给用户(含评分、人均、推荐菜、优惠信息)

城市编号

城市ID城市ID城市ID城市ID
上海1北京2大连3广州4
杭州
5 | 苏州 | 6 | 深圳 | 7 | 成都 | 8 | | 南京 | 9 | 天津 | 10 | 沈阳 | 11 | 武汉 | 12 | | 哈尔滨 | 13 | 长沙 | 14 | 厦门 | 15 | 郑州 | 16 | | 西安 | 17 | 青岛 | 18 | 重庆 | 19 | 昆明 | 20 |

错误处理

所有错误返回{error: ...}。常见情况:

  • - 请求失败或需要重新登录 → 运行dianping_login.py --renew

架构设计

  • - 后端:通过curl子进程实现纯HTTP请求(无Playwright/浏览器,无pip依赖)
  • 认证:dper + dplet Cookie存储在~/.dianping/cookies.json
  • 脚本:dianpinglogin.py(认证管理)+ dianpingapi.py(数据API)

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 dianping-search-1776300602 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 dianping-search-1776300602 技能

通过命令行安装

skillhub install dianping-search-1776300602

下载

⬇ 下载 dianping-api v1.0.0(免费)

文件大小: 21.34 KB | 发布时间: 2026-4-17 14:39

v1.0.0 最新 2026-4-17 14:39
Major update: Skill reworked into a pure API for Dianping search and shop info.

- Replaced browser-based/comparative workflow with a command-line API (no external dependencies; uses Python + curl).
- Added scripts for searching Dianping (大众点评) businesses, viewing shop details, recommended dishes, and checking deals/coupons.
- Requires only two cookies (dper, dplet) for authentication, set via helper script.
- Outputs machine-friendly JSON for all commands, suitable for integration and parsing.
- Removed scenario judgment and review analysis reference files; streamlined to direct data retrieval.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large