get_customers
Get customer analytics by dimension. Reports: segments (one-time/returning/VIP/at-risk), top (by spend or orders — includes customerId for each customer), by_country (geographic distribution — country is derived from order shipping address, not customer records; Shopify does not expose customer country without protected data access approval), customer_history (full order history with line items for a specific customer — use customerId from the 'top' report, or rank e.g. rank=1 for top customer, or tag to find by customer tag), tag_segments (size behavioural sub-segments by Shopify tag, signup year, marketing consent, and tag-overlap crosstab — BEST FOR: 'how many non-purchasers carry tag X?', 'break the newsletter list down by signup year', building differentiated nurture tracks. Defaults to the non-purchaser cohort; pass tags for the specific tags to count + cross-tabulate, purchaserFilter to change cohort). NOTE: For 'how many customers bought product X?' use get_orders(report: 'by_product') instead — it returns unique customer counts per product. This tool does NOT support product-level filtering.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tag | No | For customer_history: find customer by tag | |
| rank | No | For customer_history: look up customer by rank in top customers list (e.g. 1 = top spender) | |
| tags | No | For tag_segments: tags to count explicitly and cross-tabulate (matched case-insensitively; always included even below minTagVolume). | |
| limit | No | Number of results (default: 10) | |
| report | Yes | Report type | |
| sortBy | No | For top: totalSpent or orders (default: totalSpent) | |
| _offset | No | Pagination offset. If a response includes _pagination.hasMore=true, use _offset to fetch the next page. | |
| customerId | No | For customer_history: Shopify customer ID (from the 'top' report's customerId field) | |
| minTagVolume | No | For tag_segments: also surface any other (non-requested) tag with at least this many customers in scope (default 200). | |
| purchaserFilter | No | For tag_segments: which cohort to segment (default non_purchasers = ordersCount 0). |