Gas Price Alert
Overview
Automatically search for the cheapest gas prices in your area, with a focus on Costco and other discount stations. Get daily notifications with the best options within a specified radius.
Quick Start
- 1. Configure location - Set your city/coordinates and search radius
- Run search - Find gas stations and estimated prices
- Schedule daily alerts - Get morning notifications with cheapest options
- Focus on Costco - Costco typically has gas $0.15-0.25 below market average
Workflow
Step 1: Configure Your Location
Option A: Use ZIP code (recommended)
CODEBLOCK0
Option B: Use coordinates
Default locations are pre-configured for Columbus, Ohio:
CODEBLOCK1
To use a different location:
CODEBLOCK2
Common US cities:
- - Columbus, OH: 39.9612, -82.9988
- Chicago, IL: 41.8781, -87.6298
- New York, NY: 40.7128, -74.0060
- Los Angeles, CA: 34.0522, -118.2437
- Miami, FL: 25.7617, -80.1918
Step 2: Search for Gas Stations
CODEBLOCK3
Parameters:
- -
--zip: ZIP code (overrides lat/lon, e.g., --zip 43215) - INLINECODE2 : Latitude (default: 39.9612 - Columbus, OH)
- INLINECODE3 : Longitude (default: -82.9988 - Columbus, OH)
- INLINECODE4 : Search radius in miles (default: 20)
- INLINECODE5 : Fuel type - 87, 89, 91, diesel (default: 87)
- INLINECODE6 : Base price for estimation (default: 2.89)
- INLINECODE7 : Output file (default: gas_prices.json)
- INLINECODE8 : Print human-readable summary to stdout
Step 3: Set Up Daily Alerts
Use OpenClaw cron to receive daily morning notifications:
CODEBLOCK4
This runs every day at 8 AM Eastern Time.
Step 4: Receive Notifications
The agent will:
- 1. Search for gas stations in your area
- Identify Costco and discount stations
- Generate a summary with the cheapest options
- Send the summary via Telegram
Example notification:
CODEBLOCK5
Output Format
Each station includes:
CODEBLOCK6
How It Works
- 1. OpenStreetMap/Overpass API - Finds all gas stations in the area
- Costco database - Known Costco locations are matched and prioritized
- Price estimation - Costco prices estimated $0.15-0.25 below market average
- Distance calculation - Uses geodesic distance for accurate mileage
- Smart filtering - Removes duplicates and sorts by relevance
Limitations
- - Real-time prices: Currently uses estimated prices for Costco. For exact prices, check GasBuddy.com or station apps.
- Coverage: Relies on OpenStreetMap data completeness
- Estimation accuracy: Costco prices estimated based on typical discount patterns
For Real-Time Prices
To get actual real-time prices:
- 1. GasBuddy.com - Check manually or use their commercial API
- Station apps - Costco, Kroger, Shell, etc., have apps with current prices
- AAA - Provides average prices by region
- Waze - Community-sourced price updates
Troubleshooting
No stations found
- - Increase the
--radius parameter - Verify coordinates are correct
- Check if the area has good OpenStreetMap coverage
Incorrect prices
- - Prices for non-Costco stations are estimated as "N/A"
- Costco prices are estimates based on typical discount patterns
- For exact prices, use GasBuddy or the station's app
Geopy not installed
CODEBLOCK7
Resources
scripts/gas_alternative.py
Main script for searching gas stations using OpenStreetMap and Overpass API.
Features:
- - Finds all gas stations within radius
- Identifies Costco locations
- Estimates Costco prices
- Calculates distances
- Generates human-readable summaries
scripts/gasbuddy_search.py
Alternative script for GasBuddy integration (requires Playwright or API key).
Use when:
- - You have a GasBuddy API key
- You need real-time prices
- You're willing to use Playwright for JavaScript rendering
references/locations.md
Coordinates and configurations for common US cities.
Dependencies
Install required packages:
CODEBLOCK8
For Playwright-based GasBuddy scraping (optional):
CODEBLOCK9
油价提醒
概述
自动搜索您所在地区最便宜的油价,重点关注Costco及其他折扣加油站。每天在指定半径内获取最佳选择的通知。
快速开始
- 1. 配置位置 - 设置您的城市/坐标及搜索半径
- 运行搜索 - 查找加油站及预估价格
- 设置每日提醒 - 每天早上获取最便宜选项的通知
- 关注Costco - Costco的油价通常比市场均价低0.15-0.25美元
工作流程
第一步:配置您的位置
选项A:使用邮政编码(推荐)
bash
按邮政编码搜索
python3 scripts/gas_alternative.py --zip 43215 --radius 20 --fuel 87 --summary
选项B:使用坐标
默认位置已预设为俄亥俄州哥伦布市:
bash
俄亥俄州哥伦布市(市中心)
纬度:39.9612
经度:-82.9988
半径:20英里
使用其他位置:
bash
python3 scripts/gas_alternative.py --lat <纬度> --lon <经度> --radius <英里数>
美国常用城市:
- - 俄亥俄州哥伦布市:39.9612, -82.9988
- 伊利诺伊州芝加哥市:41.8781, -87.6298
- 纽约州纽约市:40.7128, -74.0060
- 加利福尼亚州洛杉矶市:34.0522, -118.2437
- 佛罗里达州迈阿密市:25.7617, -80.1918
第二步:搜索加油站
bash
搜索并输出摘要
python3 scripts/gas_alternative.py --lat 39.9612 --lon -82.9988 --radius 20 --fuel 87 --summary
保存到文件
python3 scripts/gas
alternative.py --lat 39.9612 --lon -82.9988 --radius 20 --fuel 87 --output gasprices.json
参数说明:
- - --zip:邮政编码(覆盖经纬度,例如 --zip 43215)
- --lat:纬度(默认:39.9612 - 俄亥俄州哥伦布市)
- --lon:经度(默认:-82.9988 - 俄亥俄州哥伦布市)
- --radius:搜索半径(英里,默认:20)
- --fuel:燃油类型 - 87、89、91、柴油(默认:87)
- --base-price:预估基准价格(默认:2.89)
- --output:输出文件(默认:gas_prices.json)
- --summary:将可读摘要打印到标准输出
第三步:设置每日提醒
使用OpenClaw定时任务接收每日早间通知:
json
{
name: 油价提醒,
schedule: {
kind: cron,
expr: 0 8 *,
tz: America/New_York
},
payload: {
kind: agentTurn,
message: 查询今天早上俄亥俄州哥伦布市的油价。重点关注Costco,显示市中心20英里范围内最便宜的87号汽油。
},
sessionTarget: main
}
该任务每天东部时间早上8点运行。
第四步:接收通知
智能助手将:
- 1. 搜索您所在地区的加油站
- 识别Costco及折扣加油站
- 生成包含最便宜选项的摘要
- 通过Telegram发送摘要
通知示例:
⛽ 油价(87号汽油)- 俄亥俄州哥伦布市
🏠 Costco(通常最便宜)
• Costco加油站
💰 $2.69(预估)
📍 5000 Morse Rd, Columbus, OH 43213(距市中心7.9英里)
💡 提示:Costco的油价通常比市场均价低0.15-0.25美元。
输出格式
每个加油站包含:
json
{
source: osm,
name: Costco加油站,
brand: Costco,
address: 5000 Morse Rd, Columbus, OH 43213,
lat: 39.9667,
lon: -82.8500,
distance: 7.9,
fuel_type: 87,
price: 2.69,
price_text: $2.69(预估),
is_costco: true,
scraped_at: 2026-02-10T21:00:00.000Z
}
工作原理
- 1. OpenStreetMap/Overpass API - 查找区域内所有加油站
- Costco数据库 - 匹配并优先显示已知的Costco位置
- 价格预估 - Costco价格按低于市场均价0.15-0.25美元估算
- 距离计算 - 使用测地距离确保里程准确
- 智能过滤 - 去除重复项并按相关性排序
局限性
- - 实时价格: 目前使用Costco的预估价格。如需精确价格,请查看GasBuddy.com或加油站应用程序。
- 覆盖范围: 依赖OpenStreetMap数据的完整性
- 预估准确性: Costco价格基于典型折扣模式估算
获取实时价格
要获取实际实时价格:
- 1. GasBuddy.com - 手动查看或使用其商业API
- 加油站应用程序 - Costco、Kroger、Shell等均有显示当前价格的应用程序
- AAA - 提供按区域划分的平均价格
- Waze - 社区来源的价格更新
故障排除
未找到加油站
- - 增加 --radius 参数
- 确认坐标正确
- 检查该区域是否有良好的OpenStreetMap覆盖
价格不准确
- - 非Costco加油站的价格显示为N/A
- Costco价格基于典型折扣模式估算
- 如需精确价格,请使用GasBuddy或加油站应用程序
未安装Geopy
bash
pip install geopy
资源
scripts/gas_alternative.py
使用OpenStreetMap和Overpass API搜索加油站的主脚本。
功能特点:
- - 查找半径内所有加油站
- 识别Costco位置
- 估算Costco价格
- 计算距离
- 生成可读摘要
scripts/gasbuddy_search.py
GasBuddy集成的备选脚本(需要Playwright或API密钥)。
使用场景:
- - 拥有GasBuddy API密钥
- 需要实时价格
- 愿意使用Playwright进行JavaScript渲染
references/locations.md
美国常用城市的坐标和配置。
依赖项
安装所需包:
bash
pip install requests geopy
对于基于Playwright的GasBuddy抓取(可选):
bash
pip install playwright
playwright install