← 返回
开发者工具 Key

kroger

Search Kroger products and add items to a Kroger cart via the Kroger API. Use when a user asks to find groceries, add items to their Kroger cart, look up Kro...
使用Kroger API搜索商品并加入购物车;当用户请求查找商品、加入Kroger购物车或查询Kroger相关信息时使用。
tongyanli-hash tongyanli-hash 来源
开发者工具 clawhub v1.0.0 1 版本 99912.1 Key: 需要
★ 0
Stars
📥 1,137
下载
💾 8
安装
1
版本
#latest

概述

Kroger

Search products, add to cart, and find store locations via the Kroger public API.

Prerequisites

  • Kroger developer account at https://developer.kroger.com
  • Registered application with Product and Cart API access
  • OAuth redirect URI configured in the Kroger app settings

Environment Variables

Set these before using:

export KROGER_CLIENT_ID="your-client-id"
export KROGER_CLIENT_SECRET="your-client-secret"

Optional:

  • KROGER_TOKEN_FILE — token storage path (default: ~/.kroger-tokens.json)
  • KROGER_REDIRECT_URI — OAuth callback URL (default: http://localhost:8888/callback)
  • KROGER_LOCATION_ID — store ID for location-specific product availability

Setup (One-Time)

1. Register a Kroger Developer App

  1. Go to https://developer.kroger.com
  2. Create an application
  3. Enable Product and Cart scopes
  4. Set redirect URI to http://localhost:8888/callback
  5. Note Client ID and Client Secret

2. Authenticate

Run the auth flow — opens a browser for Kroger login:

scripts/kroger.sh auth

If the redirect URI isn't localhost (e.g., cloud-hosted), use the manual flow:

  1. Open the AUTH_URL printed by scripts/kroger.sh auth
  2. Log in at Kroger
  3. Copy the redirected URL (even if the page errors)
  4. Extract the code parameter and run:
scripts/kroger.sh exchange <code>

Tokens auto-refresh. Re-auth only needed if refresh token expires.

Actions

Search products

scripts/kroger.sh search "cannellini beans"

Returns up to 5 results with product IDs, descriptions, and brands.

Add to cart

scripts/kroger.sh add <productId> [quantity]

Requires prior OAuth login. Quantity defaults to 1.

Find nearby stores

scripts/kroger.sh locations <zipcode>

Returns up to 5 stores with location IDs. Set KROGER_LOCATION_ID to filter product search by store.

Check auth status

scripts/kroger.sh token

Workflow: Grocery List → Cart

Typical flow for adding a grocery list to Kroger:

  1. Search each item: scripts/kroger.sh search ""
  2. Pick the best match from results
  3. Add to cart: scripts/kroger.sh add
  4. Repeat for all items

When adding many items, batch all searches first, then confirm selections with the user, then add all to cart.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 06:35 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

business-ops

Discord

steipete
当需要通过discord工具控制Discord时使用:发送消息、添加反应、发布或上传表情包、上传表情、创建投票、管理帖子/置顶/搜索、获取权限或成员/角色/频道信息,或在Discord私信或频道中处理管理操作。
★ 77 📥 37,857
business-ops

Resume Assistant

wscats
帮助求职者润色、定制、评分并导出简历,提供详细的检查清单审查和多格式支持。
★ 19 📥 21,311
business-ops

Trello

steipete
使用 Trello REST API 管理看板、列表和卡片
★ 161 📥 41,115