# Categories

List Swiggy food categories and cuisine shortcuts for a location.

- Platform: [Swiggy](https://docs.upscrape.com/docs/platforms/swiggy)
- Capability ID: `swiggy.categories`
- Cost: 1 credit per request
- Maximum runtime: 30 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 YOUR_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Prefer: wait=30" \
  --data '{
  "input": {
    "latitude": 12.9121181,
    "limit": 20,
    "longitude": 77.6445548
  },
  "capability": "swiggy.categories"
}'
```

## Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `latitude` | `number` | No | Latitude of the location. |
| `limit` | `integer` | No | Maximum number of categories. |
| `longitude` | `number` | No | Longitude of the location. |

### Example input

```json
{
  "latitude": 12.9121181,
  "limit": 20,
  "longitude": 77.6445548
}
```

## 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
{
  "items": [
    {
      "entity_id": "swiggy://explore?query=Rolls",
      "id": "600995",
      "image_id": "rng/md/carousel/production/3df4fca020027e89b89c733cdffc4966",
      "image_url": "https://media-assets.swiggy.com/swiggy/image/upload/rng/md/carousel/production/3df4fca020027e89b89c733cdffc4966",
      "latitude": 12.9121181,
      "link": "swiggy://explore?query=Rolls",
      "longitude": 77.6445548,
      "query": "Rolls",
      "rank": 1,
      "section": "Popular Cuisines",
      "source_url": "[redacted:acquisition_url]"
    },
    {
      "entity_id": "swiggy://explore?query=Pizza",
      "id": "600813",
      "image_id": "rng/md/carousel/production/5dd234f7decdac4b4f71a2ff1408e10f",
      "image_url": "https://media-assets.swiggy.com/swiggy/image/upload/rng/md/carousel/production/5dd234f7decdac4b4f71a2ff1408e10f",
      "latitude": 12.9121181,
      "link": "swiggy://explore?query=Pizza",
      "longitude": 77.6445548,
      "query": "Pizza",
      "rank": 2,
      "section": "Popular Cuisines",
      "source_url": "[redacted:acquisition_url]"
    },
    {
      "entity_id": "swiggy://explore?query=Tea",
      "id": "601016",
      "image_id": "rng/md/carousel/production/87664acb0f9dd95d10a549bb8190ab27",
      "image_url": "https://media-assets.swiggy.com/swiggy/image/upload/rng/md/carousel/production/87664acb0f9dd95d10a549bb8190ab27",
      "latitude": 12.9121181,
      "link": "swiggy://explore?query=Tea",
      "longitude": 77.6445548,
      "query": "Tea",
      "rank": 3,
      "section": "Popular Cuisines",
      "source_url": "[redacted:acquisition_url]"
    }
  ],
  "summary": {
    "latitude": 12.9121181,
    "longitude": 77.6445548,
    "source_url": "[redacted:acquisition_url]",
    "total_items": 12
  }
}
```
### Illustrative output fields

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

| Path | Observed type | Example |
| --- | --- | --- |
| `items` | `array` | 3 items |
| `items` | `array` | 3 items |
| `summary` | `object` | 4 fields |
| `summary.latitude` | `number` | 12.9121181 |
| `summary.longitude` | `number` | 77.6445548 |
| `summary.source_url` | `string` | [redacted:acquisition_url] |
| `summary.total_items` | `integer` | 12 |

## 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)
