search_shops
Searches or browses shops near the delivery location. Each result carries ashop_id and a cart_id: the cart_id encapsulates the shop and the delivery coordinates, and is the entry point for the subsequent get_shop_menu, quote_cart, and preview_order calls.
Order flow:
search_shops → shop_id + cart_id (carries delivery coordinates) → get_shop_menu to pick items → quote_cart to price the cart and get quote_id → select_address to get address_id → preview_order → preview_id + confirmation_token → create_order. Pass the shop_id / cart_id to downstream tools as-is; do not synthesize them.keyword):
- Omit / empty
keyword→ browse mode: a nearby shop feed (up to 20) with decision fields — distance, rating, delivery fee, minimum order amount, and availability. - Provide
keyword→ precise search (~5 shops):keywordmay be a shop name (“瑞幸咖啡”), a category (“奶茶”), or a concrete item name (“生椰拿铁”); the upstream search matches at the item level, so an item keyword returns the shops that actually carry it. Each shop includesmatched_items(display-only previews of the matched items). Note: in this mode distance / rating are usuallynull(upstream limitation); butdelivery_time_text/delivery_fee_textare now derived from the upstreamorderLeadTime/floatDeliveryFee(a fee of 0 shows as “免配送费”, i.e. free delivery).
Browse pagination: in browse mode (no
keyword), pass offset to page through results — send offset: 0 on the first call, then the response’s next_offset on each subsequent call, until shops comes back empty (end reached). Page size is fixed and not adjustable (it only caps how many shops one page may return). Keyword search does not support pagination.Parameters
How the delivery location is resolved: in order, ① the coordinates of the saved address behind
address_id → ② the lat/lng passed explicitly → ③ the user’s most-recently-used saved address / remembered location. If none resolve, the call returns COORDS_REQUIRED. So address_id and lat/lng are both optional, but at least one location source must be resolvable.Returns
Error Codes
See Error Handling for the full list.

