# List categories

List a store's public Instamart categories with the taxonomy needed to browse them.

- Platform: [Swiggy Instamart](https://docs.upscrape.com/docs/platforms/swiggy-instamart)
- Capability ID: `swiggy-instamart.categories.list`
- Cost: 1 credit per request
- Maximum runtime: 120 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": {
    "layout_id": "4987",
    "primary_store_id": "1392421",
    "store_id": "1392421"
  },
  "capability": "swiggy-instamart.categories.list"
}'
```

## Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `layout_id` | `string` | No | Optional homepage layout ID; defaults to 4987 (the web layout) |
| `pincode` | `string` | No | 6-digit Indian PIN code; the store serving it is resolved automatically (alternative to store_id) |
| `primary_store_id` | `string` | No | Primary store ID; defaults to store_id |
| `secondary_store_id` | `string` | No | Secondary store ID when the location has one |
| `store_id` | `string` | No | Instamart store ID (alternative to pincode; takes precedence when both are given) |

### Example input

```json
{
  "layout_id": "4987",
  "primary_store_id": "1392421",
  "store_id": "1392421"
}
```

## 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
{
  "categories": [
    {
      "id": "6822eeeded32000001e25aa1",
      "image": "NI_CATALOG/IMAGES/CIW/2025/10/8/[redacted:token]",
      "name": "Fresh Vegetables",
      "section": "Fresh items",
      "taxonomy_type": "Speciality taxonomy 1"
    },
    {
      "id": "6822eeeded32000001e25aae",
      "image": "NI_CATALOG/IMAGES/CIW/2026/8/1/[redacted:token].png",
      "name": "Fresh Fruits",
      "section": "Fresh items",
      "taxonomy_type": "Speciality taxonomy 1"
    },
    {
      "id": "6822eeeded32000001e25abb",
      "image": "NI_CATALOG/IMAGES/CIW/2025/12/24/[redacted:token].png",
      "name": "Dairy, Bread and Eggs",
      "section": "Fresh items",
      "taxonomy_type": "Speciality taxonomy 1"
    }
  ]
}
```
### Illustrative output fields

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

| Path | Observed type | Example |
| --- | --- | --- |
| `categories` | `array` | 3 items |
| `categories` | `array` | 3 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)
