# Falabella Facets API Documentation

Returns the live facet values for a query, optionally narrowed to one attribute such as brand. Each value carries a label, id, optional count and the exact live URL fragment to pass back as a search filter. Also returns category and brand id lists taken from the same facets. Failed requests (404, 422, 503) are never billed. A valid answer with zero rows is a successful, billable 200.

- **Documentation:** [https://scrappa.co/docs/falabella-api/falabella_facets](https://scrappa.co/docs/falabella-api/falabella_facets)
- **API group:** Falabella API
- **Endpoint:** `GET https://scrappa.co/api/falabella/facets`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `country` | string | Yes | Storefront country: cl (Chile, available), pe (Peru) or co (Colombia). Only countries that passed the soak are served. |
| `query` | string | Yes | Search text, for example audifonos. |
| `attribute` | string | No | Optional attribute to narrow, for example brand. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/falabella/facets?country=cl&query=audifonos&attribute=brand"
```

## Example response

```json
{
    "success": true,
    "data": {
        "country": "cl",
        "query": "audifonos",
        "attribute": "brand",
        "facets": [
            {
                "name": "Marca",
                "id": "brand",
                "values": [
                    {
                        "id": "samsung",
                        "label": "Samsung",
                        "count": 42,
                        "url": "f.static.popularBrands=samsung",
                        "selected": false
                    }
                ]
            }
        ],
        "categories": [],
        "brands": [
            {
                "id": "samsung",
                "name": "Samsung",
                "url": "f.static.popularBrands=samsung"
            }
        ]
    },
    "meta": {
        "endpoint_family": "facets",
        "country": "cl",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required parameter is missing or invalid. |
| 404 | Not Found | The upstream product or location was not found. |
| 503 | Upstream Unavailable | The public storefront did not answer. No credit was charged. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
