# Get search categories

Return hierarchical category and subcategory candidates discovered from listing pages.

- Platform: [Flipkart Commerce](https://docs.upscrape.com/docs/platforms/flipkart)
- Capability ID: `flipkart.search.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 $UPSCRAPE_API_KEY" \
  --header "Content-Type: application/json" \
  --header "Prefer: wait=30" \
  --data '{
  "input": {
    "max_results": 20,
    "query": "mobiles"
  },
  "capability": "flipkart.search.categories"
}'
```

## Input


| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `include_filters` | `boolean` | No | Return result filters (brand, price, rating ...) alongside categories (default true) |
| `max_filter_values` | `integer` | No | Most values returned per filter (default 10); value_count gives the full number From 1 to 100. |
| `max_results` | `integer` | No | Most child categories returned at each level of the tree (default 20) From 1 to 100. |
| `query` | `string` | Yes | Search query. |

### Example input

```json
{
  "max_results": 20,
  "query": "mobiles"
}
```

## 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 example shows one response. Values and optional fields vary with the data available.

```json
{
  "breadcrumbs": [
    {
      "name": "Home",
      "url": "https://www.flipkart.com/"
    },
    {
      "name": "Mobiles & Accessories",
      "url": "https://www.flipkart.com/mobiles-accessories/pr?sid=tyy&marketplace=FLIPKART"
    },
    {
      "name": "Mobiles",
      "url": "https://www.flipkart.com/mobiles/pr?sid=tyy,4io&marketplace=FLIPKART"
    }
  ],
  "categories": [
    {
      "category_id": "tyy",
      "children": [
        {
          "category_id": "tyy/4io",
          "has_children": false,
          "matched_source": "facets",
          "name": "Mobiles",
          "path": "mobiles/pr?sid=tyy,4io",
          "url": "https://www.flipkart.com/mobiles/pr?sid=tyy,4io&q=mobiles"
        }
      ],
      "has_children": true,
      "matched_source": "facets",
      "name": "Mobiles & Accessories",
      "path": "mobiles-accessories/pr?sid=tyy",
      "url": "https://www.flipkart.com/mobiles-accessories/pr?sid=tyy&q=mobiles"
    }
  ],
  "filters": [
    {
      "id": "brand",
      "multi_select": true,
      "name": "Brand",
      "type": "options",
      "value_count": 134,
      "values": [
        {
          "count": 457,
          "name": "Apple",
          "param": "facets.brand[]=Apple",
          "selected": false
        },
        {
          "count": 36,
          "name": "Google",
          "param": "facets.brand[]=Google",
          "selected": false
        },
        {
          "count": 262,
          "name": "MOTOROLA",
          "param": "facets.brand[]=MOTOROLA",
          "selected": false
        }
      ]
    },
    {
      "id": "ram",
      "multi_select": false,
      "name": "Ram",
      "type": "options",
      "value_count": 7,
      "values": [
        {
          "count": 549,
          "name": "1 GB and Below",
          "param": "facets.ram[]=1 GB and Below",
          "selected": false
        },
        {
          "count": 2217,
          "name": "1GB and Below",
          "param": "facets.ram[]=1GB and Below",
          "selected": false
        },
        {
          "count": 255,
          "name": "2 GB",
          "param": "facets.ram[]=2 GB",
          "selected": false
        }
      ]
    },
    {
      "id": "network_type",
      "multi_select": false,
      "name": "Network Type",
      "type": "options",
      "value_count": 6,
      "values": [
        {
          "count": 5699,
          "name": "2G",
          "param": "facets.network_type[]=2G",
          "selected": false
        },
        {
          "count": 4519,
          "name": "3G",
          "param": "facets.network_type[]=3G",
          "selected": false
        },
        {
          "count": 4321,
          "name": "4G",
          "param": "facets.network_type[]=4G",
          "selected": false
        }
      ]
    }
  ],
  "query": "mobiles",
  "source": "search.page",
  "total_products": 7886
}
```
### Illustrative output fields

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

| Path | Observed type | Example |
| --- | --- | --- |
| `breadcrumbs` | `array` | 3 items |
| `breadcrumbs` | `array` | 3 items |
| `categories` | `array` | 1 items |
| `categories` | `array` | 1 items |
| `filters` | `array` | 3 items |
| `filters` | `array` | 3 items |
| `query` | `string` | mobiles |
| `source` | `string` | search.page |
| `total_products` | `integer` | 7886 |

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