# Categories List

Fetch the Carrefour KSA category tree from the storefront menu, flattened into parent-linked rows with leaf flags; leaf ids feed carrefourksa.category.products.list.

- Platform: [Carrefour KSA](https://docs.upscrape.com/docs/platforms/carrefourksa)
- Capability ID: `carrefourksa.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 -X POST https://data.upscrape.com/execute \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":{},"capability":"carrefourksa.categories.list"}'
```

## Input

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `latitude` | `string` | No | Store catchment latitude. Defaults to 24.7136 (Riyadh). |
| `longitude` | `string` | No | Store catchment longitude. Defaults to 46.6753 (Riyadh). |

### Example input

```json
{}
```

## 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": "FKSA1600000",
      "leaf": false,
      "level": 1,
      "name": "Fresh Food",
      "parent": "",
      "thumbnail": "https://cdnprod.mafretailproxy.com/sys-master-root/hea/h28/10752247365662/FreshFood.png",
      "title": "Fresh Food",
      "url": "/c/FKSA1600000"
    },
    {
      "id": "FKSA1620000",
      "leaf": false,
      "level": 2,
      "name": "Chilled Food Counter",
      "parent": "FKSA1600000",
      "thumbnail": "https://framestrapimaster.blob.core.windows.net/assets/images/[redacted:token].png",
      "title": "Chilled Food Counter",
      "url": "/c/FKSA1620000"
    },
    {
      "id": "FKSA1620100",
      "leaf": true,
      "level": 3,
      "name": "Cold Cuts & Meat Snacks",
      "parent": "FKSA1620000",
      "thumbnail": "https://hybrisproduction.blob.core.windows.net/sys-master-prod/L3-images/FreshFood/1620100.png",
      "title": "Cold Cuts & Meat Snacks",
      "url": "/c/FKSA1620100"
    }
  ]
}
```
### 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.

See [jobs and results](https://docs.upscrape.com/docs/api/jobs), [errors and retries](https://docs.upscrape.com/docs/api/errors), and [idempotency](https://docs.upscrape.com/docs/api/idempotency).

## Machine-readable contract

- [Capability OpenAPI 3.1](https://docs.upscrape.com/docs/platforms/carrefourksa/carrefourksa.categories.list/openapi.json)
- [Platform OpenAPI 3.1](https://upscrape.com/scrapers/carrefourksa/openapi.json)
- [Focused coding-agent prompt](https://upscrape.com/scrapers/carrefourksa/capabilities/carrefourksa.categories.list/llm.md)
