# Mercado Libre Category Discovery API Documentation

Maps a free text such as notebook to the Mercado Libre categories and product domains that fit it, with category id, category name and detected attributes. Use the returned category_id with the category products, categories and category attributes endpoints. The endpoint returns up to 8 matches and has no paging. Failed requests (404, 422, 503) are never billed. A valid answer with zero rows is a successful, billable 200.

- **Documentation:** [https://scrappa.co/docs/mercadolibre-api/mercadolibre_category_discovery](https://scrappa.co/docs/mercadolibre-api/mercadolibre_category_discovery)
- **API group:** Mercado Libre API
- **Endpoint:** `GET https://scrappa.co/api/mercadolibre/category-discovery`

## 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 |
| --- | --- | --- | --- |
| `site` | string | Yes | Country site id: MLA (Argentina), MLB (Brazil), MLM (Mexico), MLC (Chile), MCO (Colombia), MPE (Peru), MLU (Uruguay), MEC (Ecuador) or MLV (Venezuela). |
| `q` | string | Yes | Product text, for example notebook. |
| `limit` | integer | No | Matches to return, 1 to 8. Defaults to 3. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/mercadolibre/category-discovery?site=MLA&q=notebook&limit=2"
```

## Example response

```json
{
    "success": true,
    "data": {
        "query": "notebook",
        "categories": [
            {
                "domain_id": "MLA-NOTEBOOKS",
                "domain_name": "Notebooks",
                "category_id": "MLA1652",
                "category_name": "Notebooks",
                "attributes": []
            },
            {
                "domain_id": "MLA-NOTEBOOKS_AND_NETBOOKS_REPAIR_SERVICES",
                "domain_name": "Servicios de reparaci\u00f3n de notebooks y netbooks",
                "category_id": "MLA11801",
                "category_name": "Notebooks y Netbooks",
                "attributes": []
            }
        ],
        "total": 2
    },
    "meta": {
        "endpoint_family": "category_discovery",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 404 | Not Found | The item, category or store does not exist on this site. This response is not billable. |
| 422 | Validation Error | A parameter is invalid: unknown site, an id that does not belong to the site, a limit out of range, rating other than 1 to 5, or a zip code of another country. This response is not billable. |
| 503 | Service Unavailable | The service could not obtain a complete result from Mercado Libre. This response is not billable. |

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