← Back to Skills Marketplace
realank

Coffee Prices by City

by Realank · GitHub ↗ · v1.0.0
cross-platform ✓ Security Clean
276
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install coffee-prices
Description
Fetch and compare mainstream coffee prices (latte, americano, etc.) from major chains like Starbucks, Luckin, and Cotti for a given Chinese city and output t...
README (SKILL.md)

Coffee Prices by City

获取当前城市主流连锁品牌咖啡(如星巴克、瑞幸、库迪等)的代表性品类(拿铁、美式等)价格,并以表格形式输出,方便横向对比。

⚠️ 说明:本技能内置的是按城市分级的「参考价」,适合作为对比和定价参考,不保证与每家门店实时售价完全一致。需要严谨财务/报销场景时,请以官方 App 或点单小程序为准。

能力概览

  • 按城市查看咖啡价格:输入城市名(如「上海」「北京」「成都」),获取该城市的主流品牌咖啡参考价。
  • 多品牌对比:支持星巴克、瑞幸、库迪,可扩展更多品牌。
  • 多品类对比:默认包含拿铁、美式、卡布奇诺、摩卡等常见品类。
  • 多种输出格式:支持 Markdown 表格(适合在对话中直接查看)、JSON、CSV。
  • 自动推断城市(可选):未显式传入城市时,尝试通过 IP 定位推断当前城市。

快速开始

1. 在本地安装依赖

pip install -r requirements.txt

2. 指定城市查询(推荐)

python3 scripts/coffee_prices.py \
  --city "上海" \
  --brands starbucks,luckin,cotti \
  --drinks latte,americano,cappuccino,mocha \
  --output markdown

3. 使用当前城市(IP 自动推断)

python3 scripts/coffee_prices.py --output markdown

4. 以 JSON / CSV 形式输出(便于后续加工)

# JSON
python3 scripts/coffee_prices.py --city "北京" --output json

# CSV
python3 scripts/coffee_prices.py --city "深圳" --output csv > coffee_prices_sz.csv

参数说明

脚本入口:scripts/coffee_prices.py

  • --city:城市名称(中文),如 上海北京成都
    • 省略时,脚本会尝试:
      1. 读取环境变量 OPENCLAW_CITY
      2. 通过 IP 定位接口自动推断当前城市
  • --brands:要查询的品牌,逗号分隔。支持值:
    • starbucks(星巴克)
    • luckin(瑞幸)
    • cotti(库迪)
    • 默认:starbucks,luckin,cotti
  • --drinks:要查询的咖啡品类,逗号分隔。支持值:
    • latte(拿铁)
    • americano(美式)
    • cappuccino(卡布奇诺)
    • mocha(摩卡)
    • 默认:latte,americano,cappuccino,mocha
  • --output:输出格式:
    • markdown(默认):Markdown 表格
    • json:结构化 JSON
    • csv:逗号分隔表格数据

输出示例(Markdown 表格)

示例命令:

python3 scripts/coffee_prices.py --city "上海" --output markdown

示例输出:

| 品牌 | 品牌英文 | 城市 | 品类 | 参考价格(元) |
| ---- | -------- | ---- | ---- | ------------ |
| 星巴克 | starbucks | 上海 | 拿铁 | 38.0 |
| 星巴克 | starbucks | 上海 | 美式 | 32.0 |
| 瑞幸 | luckin | 上海 | 拿铁 | 24.0 |
| 瑞幸 | luckin | 上海 | 美式 | 20.0 |
| 库迪 | cotti | 上海 | 拿铁 | 22.0 |
| 库迪 | cotti | 上海 | 美式 | 18.0 |

真实输出会根据城市「分级系数」做轻微上/下浮动,反映一线/二线/三线城市的价格差异。

城市分级与价格逻辑

脚本内置一个简单的 城市分级 + 价格系数模型

  • 一线城市(tier1):如北京、上海、深圳、广州、杭州等,价格系数略高
  • 二线城市(tier2):默认档位
  • 三线及以下(tier3):价格系数略低

每个品牌有一套「全国基础价」,根据城市档位乘以不同系数后,得到该城市的参考价。
如果城市未出现在内置城市列表中,会按照二线城市处理。

你可以直接修改 scripts/coffee_prices.py 中的 CITY_TIERSBASE_PRICES,替换为你自己调研的更精确价格,或者接入官方 API / 爬虫逻辑。

在 OpenClaw 中使用

  • 技能名称coffee-prices
  • 推荐触发描述
    • 「帮我看下上海星巴克/瑞幸/库迪一杯拿铁和美式大概多少钱,并做成表格」
    • 「对比一下北京和成都的星巴克咖啡价格」
    • 「给我一份当前城市主流连锁咖啡价格表,方便做定价参考」

推荐由 Agent 调用脚本时:

  1. 优先从对话中抽取城市信息(如「上海」「北京」);如果没有,则调用脚本让其自动推断城市。
  2. 默认查询 starbucks,luckin,cotti 三个品牌,latte,americano,cappuccino,mocha 四个品类。
  3. 选择 markdown 输出,并直接将表格返回给用户。

限制与注意事项

  • 价格为参考价:并非实时抓取官方价格,仅按城市分级对基础价做调整。
  • 品牌/品类可扩展:可以在脚本中补充更多品牌(Manner、Seesaw 等)和更多品类。
  • 网络依赖(自动定位):自动通过 IP 推断城市时,需要可以访问外网(https://ipinfo.io/json);在离线或受限网络环境下,请显式传入 --city

如果你需要我进一步根据你调研的真实价格数据,把 BASE_PRICES 改成真实价格表,或者增加新的品牌/品类,可以直接在对话中提供数据(可以是表格或 JSON),我会帮你改好脚本和文档。

Usage Guidance
This skill appears to be what it says: a local Python script that returns city-level reference prices. Before running: (1) review the BASE_PRICES and CITY_TIERS in scripts/coffee_prices.py if you need different values; (2) be aware the script may call https://ipinfo.io/json to auto-detect city when no --city or OPENCLAW_CITY is provided (network access required); (3) installing dependencies will pull the requests package from PyPI—run installs in a virtualenv or sandbox if you prefer; (4) the OPENCLAW_CITY env var is optional (not listed as required), so set it if you want deterministic behavior without external network calls.
Capability Analysis
Type: OpenClaw Skill Name: coffee-prices Version: 1.0.0 The skill is a legitimate utility for comparing coffee prices across different brands and cities in China. It uses hardcoded price data and a city-tier multiplier logic, with an optional feature to infer the user's city via a public IP geolocation API (ipinfo.io) as documented in scripts/coffee_prices.py and SKILL.md.
Capability Assessment
Purpose & Capability
Name/description align with included code and SKILL.md. The script computes reference prices from embedded BASE_PRICES and CITY_TIERS and formats output as markdown/json/csv as advertised. Use of the requests library and an optional IP geolocation lookup is coherent with the advertised 'auto-detect city' feature.
Instruction Scope
SKILL.md and the CLI instruct the agent to optionally infer city from IP via https://ipinfo.io/json and to read an optional environment variable OPENCLAW_CITY. The instructions do not access unrelated system files or credentials. Note: OPENCLAW_CITY is used if present but not declared as a required env var (it's optional).
Install Mechanism
No registry install spec; this is effectively an instruction-only skill with provided Python scripts and a requirements.txt listing requests>=2.31.0. Installing dependencies via pip will fetch from PyPI (expected). No downloads from untrusted URLs or archives are present.
Credentials
The skill does not require credentials or secret environment variables. It does optionally read OPENCLAW_CITY and performs an outbound HTTPS request for IP-based geolocation. The optional env var is reasonable for the feature, but the registry metadata lists no environment variables while the runtime supports one optional variable.
Persistence & Privilege
No elevated persistence requested (always:false). The skill does not modify other skills or system settings and has no install-time hooks in the registry metadata.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install coffee-prices
  3. After installation, invoke the skill by name or use /coffee-prices
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
coffee-prices v1.0.0 - Initial release with support for fetching and comparing latte, americano, cappuccino, and mocha prices from Starbucks, Luckin, and Cotti in major Chinese cities. - Provides reference prices by city tier (tier1/tier2/tier3), reflecting common local pricing. - Supports output in Markdown table (default), JSON, and CSV formats. - Allows manual city input, or automatic city detection via IP if not specified. - Extensible to add more brands and drink types with simple script edits.
Metadata
Slug coffee-prices
Version 1.0.0
License
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Coffee Prices by City?

Fetch and compare mainstream coffee prices (latte, americano, etc.) from major chains like Starbucks, Luckin, and Cotti for a given Chinese city and output t... It is an AI Agent Skill for Claude Code / OpenClaw, with 276 downloads so far.

How do I install Coffee Prices by City?

Run "/install coffee-prices" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Coffee Prices by City free?

Yes, Coffee Prices by City is completely free (open-source). You can download, install and use it at no cost.

Which platforms does Coffee Prices by City support?

Coffee Prices by City is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Coffee Prices by City?

It is built and maintained by Realank (@realank); the current version is v1.0.0.

💬 Comments