# Category taxonomy

Extract public category links from an IndiaMART directory or category landing page.

- Platform: [IndiaMART Directory](https://docs.upscrape.com/docs/platforms/indiamart)
- Capability ID: `indiamart.category.taxonomy`
- Cost: 1 credit per request
- Maximum runtime: 60 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": {
    "max_depth": 1
  },
  "capability": "indiamart.category.taxonomy"
}'
```

## Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `max_depth` | `integer` | No | Follow at most one bounded level of category links. |
| `url` | `string` | No | Optional public IndiaMART directory root or category URL. |

### Example input

```json
{
  "max_depth": 1
}
```

## 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": [
    {
      "children": [
        {
          "name": "Lycopene Syrup",
          "url": "https://dir.indiamart.com/impcat/lycopene-syrup.html"
        },
        {
          "name": "Pharmaceutical Drug",
          "url": "https://dir.indiamart.com/impcat/pharmaceutical-drug.html"
        },
        {
          "name": "Acetylcysteine Tablet",
          "url": "https://dir.indiamart.com/impcat/acetylcysteine-tablet.html"
        }
      ],
      "name": "Pharmaceutical Medicines",
      "url": "https://dir.indiamart.com/impcat/pharmaceutical-medicines.html"
    },
    {
      "children": [
        {
          "name": "Thyroxine Sodium Tablets",
          "url": "https://dir.indiamart.com/impcat/thyroxine-sodium-tablets.html"
        },
        {
          "name": "Mirabegron Tablet",
          "url": "https://dir.indiamart.com/impcat/mirabegron-tablet.html"
        },
        {
          "name": "Tolvaptan Tablet",
          "url": "https://dir.indiamart.com/impcat/tolvaptan-tablet.html"
        }
      ],
      "name": "Pharmaceutical Tablets",
      "url": "https://dir.indiamart.com/impcat/pharmaceutical-tablets.html"
    },
    {
      "children": [
        {
          "name": "Allopathic Cough Syrup",
          "url": "https://dir.indiamart.com/impcat/allopathic-cough-syrup.html"
        },
        {
          "name": "Homoeopathic Syrup",
          "url": "https://dir.indiamart.com/impcat/homoeopathic-syrup.html"
        },
        {
          "name": "Pharmaceutical Syrup",
          "url": "https://dir.indiamart.com/impcat/pharmaceutical-syrup.html"
        }
      ],
      "name": "Cough Syrup",
      "url": "https://dir.indiamart.com/impcat/cough-syrup.html"
    }
  ],
  "url": "https://dir.indiamart.com/"
}
```
### 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 |
| `url` | `string` | https://dir.indiamart.com/ |

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