# Summarize search facets

Derive brand, category, price, discount and stock facet counts from Zepto search results for a keyword and delivery location.

- Platform: [Zepto](https://docs.upscrape.com/docs/platforms/zepto)
- Capability ID: `zepto.search.facets`
- Cost: 1 credit per request
- Maximum runtime: 180 seconds
- Execute endpoint: `POST https://data.upscrape.com/execute`

## Request

Use the exact public capability ID in the shared execute envelope.

```bash
curl --request POST \
  --url https://data.upscrape.com/execute \
  --header "Authorization: Bearer $UPSCRAPE_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Prefer: wait=30" \
  --data '{
  "input": {
    "limit": 50,
    "pincode": "560067",
    "query": "rice"
  },
  "capability": "zepto.search.facets"
}'
```

## Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `latitude` | `number` | No | Latitude for location-based store resolution. |
| `limit` | `integer` | No | Number of search results to analyze. Facet counts describe this sample, not the full result set. |
| `longitude` | `number` | No | Longitude for location-based store resolution. |
| `max_pages` | `integer` | No | Maximum number of pages to fetch. |
| `pincode` | `string` | No | Six-digit Indian pincode. When provided, Upscrape resolves coordinates and the Zepto delivery store automatically. |
| `query` | `string` | Yes | Search query string. |
| `store_id` | `string` | No | Zepto store ID. Defaults to the public Bangalore sample store. |

### Example input

```json
{
  "limit": 50,
  "pincode": "560067",
  "query": "rice"
}
```

## Response

Successful output is returned in `results[0].data`. Raw platform output is intentionally open-ended and may evolve with the upstream source.

### Illustrative sample output

This redacted fixture is an example, not a fixed response schema.

```json
{
  "availability": {
    "in_stock": 50,
    "out_of_stock": 0,
    "unknown": 0
  },
  "brands": [
    {
      "count": 12,
      "id": "8f0fa49a-9afe-41b5-b9bc-7fdea8af7d15",
      "value": "Daawat"
    },
    {
      "count": 8,
      "id": "06b3a6c8-9762-46d2-83c5-1623b7d3a508",
      "value": "Daily Good"
    },
    {
      "count": 6,
      "id": "c8ffb149-9e09-4c74-9b33-05e20b065068",
      "value": "India Gate"
    }
  ],
  "captured_at": "2026-09-25T13:53:32.763725924Z",
  "categories": [
    {
      "count": 49,
      "id": "2f7190d0-7c40-458b-b450-9a1006db3d95",
      "value": "Atta, Rice, Oil & Dals"
    },
    {
      "count": 1,
      "id": "dfe16918-81b1-49c3-941b-acd557f7c277",
      "value": "Zepto Cafe"
    }
  ],
  "discount_ranges": [
    {
      "count": 6,
      "label": "1% - 9%",
      "max": 10,
      "min": 1
    },
    {
      "count": 24,
      "label": "10% - 24%",
      "max": 25,
      "min": 10
    },
    {
      "count": 18,
      "label": "25% - 49%",
      "max": 50,
      "min": 25
    }
  ],
  "has_more": true,
  "location": {
    "eta_minutes": 21,
    "eta_serviceable": true,
    "latitude": 12.9967012,
    "longitude": 77.758197,
    "pincode": "560067",
    "secondary_store_ids": [
      "0059ff6a-7eb0-477a-a7f5-69256f2c444b"
    ],
    "serviceable": true,
    "store_id": "e58fff62-7695-44c2-aba0-6bc96074bc64",
    "store_ids": [
      "e58fff62-7695-44c2-aba0-6bc96074bc64",
      "0059ff6a-7eb0-477a-a7f5-69256f2c444b"
    ]
  },
  "location_eta_in_minutes": 21,
  "location_eta_serviceable": true,
  "location_latitude": 12.9967012,
  "location_longitude": 77.758197,
  "location_secondary_store_ids": [
    "0059ff6a-7eb0-477a-a7f5-69256f2c444b"
  ],
  "location_serviceable": true,
  "location_store_id": "e58fff62-7695-44c2-aba0-6bc96074bc64",
  "location_store_ids": [
    "e58fff62-7695-44c2-aba0-6bc96074bc64",
    "0059ff6a-7eb0-477a-a7f5-69256f2c444b"
  ],
  "price_max_paise": 261200,
  "price_min_paise": 4700,
  "price_ranges": [
    {
      "count": 1,
      "label": "Under ₹50",
      "max": 5000,
      "min": 0
    },
    {
      "count": 14,
      "label": "₹50 - ₹100",
      "max": 10000,
      "min": 5000
    },
    {
      "count": 5,
      "label": "₹100 - ₹200",
      "max": 20000,
      "min": 10000
    }
  ],
  "products_analyzed": 50,
  "query": "rice",
  "subcategories": [
    {
      "count": 14,
      "id": "9798b797-0db0-4b04-b198-31b0a5849318",
      "value": "Rice & More"
    }
  ]
}
```
### Illustrative output fields

Derived from the sample above for orientation only. These fields are not a fixed response schema.

| Path | Observed type | Example |
| --- | --- | --- |
| `availability` | `object` | 3 fields |
| `availability.in_stock` | `integer` | 50 |
| `availability.out_of_stock` | `integer` | 0 |
| `availability.unknown` | `integer` | 0 |
| `brands` | `array` | 3 items |
| `brands` | `array` | 3 items |
| `captured_at` | `string` | 2026-09-25T13:53:32.763725924Z |
| `categories` | `array` | 2 items |
| `categories` | `array` | 2 items |
| `discount_ranges` | `array` | 3 items |
| `discount_ranges` | `array` | 3 items |
| `has_more` | `boolean` | true |
| `location` | `object` | 9 fields |
| `location.eta_minutes` | `integer` | 21 |
| `location.eta_serviceable` | `boolean` | true |
| `location.latitude` | `number` | 12.9967012 |
| `location.longitude` | `number` | 77.758197 |
| `location.pincode` | `string` | 560067 |
| `location.secondary_store_ids` | `array` | 1 items |
| `location.serviceable` | `boolean` | true |
| `location.store_id` | `string` | e58fff62-7695-44c2-aba0-6bc96074bc64 |
| `location.store_ids` | `array` | 2 items |
| `location_eta_in_minutes` | `integer` | 21 |
| `location_eta_serviceable` | `boolean` | true |
| `location_latitude` | `number` | 12.9967012 |
| `location_longitude` | `number` | 77.758197 |
| `location_secondary_store_ids` | `array` | 1 items |
| `location_secondary_store_ids` | `array` | 1 items |
| `location_serviceable` | `boolean` | true |
| `location_store_id` | `string` | e58fff62-7695-44c2-aba0-6bc96074bc64 |
| `location_store_ids` | `array` | 2 items |
| `location_store_ids` | `array` | 2 items |
| `price_max_paise` | `integer` | 261200 |
| `price_min_paise` | `integer` | 4700 |
| `price_ranges` | `array` | 3 items |
| `price_ranges` | `array` | 3 items |
| `products_analyzed` | `integer` | 50 |
| `query` | `string` | rice |
| `subcategories` | `array` | 1 items |
| `subcategories` | `array` | 1 items |

## Execution behavior

A `200` response completed inline. A `202` response was queued; poll `GET /jobs/{id}` until the job reaches `completed` or `failed`. Use an `Idempotency-Key` when retrying must not create a duplicate logical job.

## Related documentation

- [Authentication](https://docs.upscrape.com/docs/api/authentication)
- [Jobs and results](https://docs.upscrape.com/docs/api/jobs)
- [Errors and retries](https://docs.upscrape.com/docs/api/errors)
- [Idempotency](https://docs.upscrape.com/docs/api/idempotency)
