← 返回
开发者工具

Foodpanda.ph Ordering

Order food from foodpanda.ph using the foodpanda-cli command-line tool. Use when the user wants to search restaurants, browse menus, build a cart, or place a...
使用foodpanda-cli命令行工具在foodpanda.ph上订餐,适用于搜索餐厅、浏览菜单、添加购物车或下单等场景。
johnwhoyou
开发者工具 clawhub v1.1.0 1 版本 99853.8 Key: 无需
★ 0
Stars
📥 683
下载
💾 9
安装
1
版本
#latest

概述

foodpanda-cli

A command-line tool for ordering food delivery from foodpanda.ph. All commands output structured JSON to stdout. Designed for the Philippines market only.

Prerequisites & Installation

Ensure Node.js 18+ and npm are available, then install globally:

npm install -g foodpanda-cli

Verify the installation:

foodpanda-cli --version

Initial Setup (One-Time)

Before using any other commands, complete these two setup steps:

1. Set delivery location

Provide the user's delivery coordinates (latitude and longitude in the Philippines):

foodpanda-cli location <latitude> <longitude>

Example:

foodpanda-cli location 14.5995 120.9842
# => {"success": true, "latitude": 14.5995, "longitude": 120.9842}

2. Log in

Opens a browser window for the user to log in to their foodpanda account. The session token is captured automatically. This step requires user interaction.

foodpanda-cli login

An optional --timeout flag controls how long to wait (default: 120s).

Command Reference

Search & Discovery

Search restaurants:

foodpanda-cli search <query> [--cuisine <type>] [--limit <n>]

Returns an array of matching restaurants with id (vendor code), name, cuisine, rating, delivery_fee, delivery_time, is_open, and optionally chain_code.

List chain outlets:

foodpanda-cli outlets <chain_code>

Lists all branches of a restaurant chain. Use the chain_code from search results.

Get restaurant details:

foodpanda-cli restaurant <vendor_code>

Returns full details: address, description, opening hours, delivery availability.

Menu & Items

Browse menu:

foodpanda-cli menu <vendor_code>

Returns the menu organized by category. Each item includes code, name, price, and description. Use item codes for adding to cart.

Get item details (toppings & variations):

foodpanda-cli item <vendor_code> <product_code>

Returns full item details including topping_groups (with options, prices, and min/max quantities) and variation info. Always check this before adding items with customizations.

Cart Management

Add items to cart:

foodpanda-cli add <vendor_code> --items '<json_array>'

The --items flag takes a JSON array. Each element:

[
  {
    "item_id": "product-code",
    "quantity": 1,
    "topping_ids": ["101", "205"],
    "special_instructions": "No onions"
  }
]

Only item_id and quantity are required. topping_ids and special_instructions are optional.

View cart:

foodpanda-cli cart

Returns the current cart with all items, quantities, prices, fees, and total. Returns {"message": "Cart is empty."} if empty.

Remove item from cart:

foodpanda-cli remove <cart_item_id>

Remove an item by its cart_item_id (e.g., cart-1, cart-2). These IDs are shown in cart output.

Ordering

Preview order:

foodpanda-cli preview

Returns the full order preview: cart contents, selected delivery address, available payment methods, and totals. Always run this before placing an order.

Place order:

foodpanda-cli order --payment <method> [--instructions <text>]

Places the order. Returns order_id, status, estimated_delivery_time, and total.

Currently only payment_on_delivery (Cash on Delivery) is supported as the payment method.

Recommended Workflow

Follow these steps when the user wants to order food:

  1. Check setup — Ensure location and login are configured. If the user hasn't set these up, run location and login first.
  2. Search — Ask the user what they want to eat, then run search to find restaurants.
  3. Present options — Show the user matching restaurants with names, cuisines, ratings, and delivery times.
  4. Browse menu — Once the user picks a restaurant, run menu to see available items.
  5. Check item details — If the user wants customizations, run item to see available toppings and variations.
  6. Build cart — Use add to add items. Show the user the cart after each addition.
  7. Preview — Run preview to show the final order summary with delivery address and total.
  8. Confirm and order — ONLY after the user explicitly confirms, run order --payment payment_on_delivery.

Important Rules

  • ALWAYS confirm with the user before running the order command. This places a real order with real money. Never run it without explicit user approval.
  • Payment: Only payment_on_delivery (Cash on Delivery) works. Do not attempt other payment methods.
  • Cart switching: Adding items from a different restaurant clears the existing cart. Warn the user before doing this.
  • Errors: All errors are returned as {"error": "message"}. If you get an authentication error, prompt the user to run login again.
  • Location required: All commands except location and login require a delivery location to be set first.
  • Philippines only: This tool only works with foodpanda.ph for delivery addresses in the Philippines.

Common Patterns

Filtering by cuisine

foodpanda-cli search "pizza" --cuisine "Italian" --limit 5

Ordering with toppings

  1. Get item details to find topping IDs:

```bash

foodpanda-cli item p7nl ct-36-pd-1673

```

  1. Add with selected toppings:

```bash

foodpanda-cli add p7nl --items '[{"item_id":"ct-36-pd-1673","quantity":1,"topping_ids":["101","205"]}]'

```

Finding a specific branch of a chain

  1. Search returns chain_code for chain restaurants
  2. List all branches:

```bash

foodpanda-cli outlets cg0ep

```

  1. Pick the closest/preferred branch and use its vendor code for menu and ordering

版本历史

共 1 个版本

  • v1.1.0 当前
    2026-03-30 12:43 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,927
developer-tools

Agent Browser

matrixy
专为AI智能体优化的无头浏览器自动化CLI,支持无障碍树快照和基于引用的元素选择。
★ 427 📥 118,385
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,473