Skip to content
Scrappa Get API key
Ricardo API 1 credit/request

Ricardo Categories API Documentation

GET https://scrappa.co/api/ricardo/categories

Ricardo Categories API Documentation Retrieve the Ricardo.ch category tree as a flat list: category id, name, tree level (1 is top level), leaf flag and parent id. Filter by parent category or level. Use the ids with the search and category endpoints. The tree changes rarely and is cached for 24 hours.

Ricardo Categories API Documentation 1 credit/request

Endpoint

Request preview
GET
https://scrappa.co/api/ricardo/categories
Auth header
x-api-key
Cost
1 credit/request
Response preview
200 OK
{
    "data": {
        "total": 28,
        "categories": [
            {
                "name": "Antiquit\u00e4ten & Kunst",
                "level": 1,
                "is_leaf": false,
                "category_id": "38399"
            },
            {
                "name": "Briefmarken",
                "level": 1,
                "is_leaf": false,
...

Parameters

Start with the required fields, then add optional filters only when your use case needs them.

Runnable path

This endpoint has no required query parameters.

3 optional filters available.

parent_id string Optional

Return only the direct children of this category number, e.g. 41950. Omit to return the full tree as a flat list.

Example value 1234567890
level integer Optional

Return only categories of this tree level, 1 (top level) to 6.

Example value 10
language string Optional

Language of labels and the listing url: de or fr. Defaults to de.

Example value en

Response Schema

Example response fields are illustrative; inspect the JSON before integrating.

Example response fields

Scan these fields before integrating.

data meta success
JSON Response
200 OK
{
    "data": {
        "total": 28,
        "categories": [
            {
                "name": "Antiquit\u00e4ten & Kunst",
                "level": 1,
                "is_leaf": false,
                "category_id": "38399"
            },
            {
                "name": "Briefmarken",
                "level": 1,
                "is_leaf": false,
                "category_id": "38766"
            },
            {
                "name": "B\u00fccher & Comics",
                "level": 1,
                "is_leaf": false,
                "category_id": "38889"
            }
        ]
    },
    "meta": {
        "billable": true,
        "endpoint_family": "categories"
    },
    "success": true
}

Errors

Handle these documented responses before retrying or showing customer-facing failures.

422

Validation Error

The parent_id is not a category number, or the level or language is out of range. This response is not billable.

{
    "errors": {
        "level": [
            "The level must be between 1 and 6."
        ]
    },
    "message": "The request validation failed"
}
404

Resource Not Found

The parent_id does not exist in the category tree. This response is not billable.

{
    "error": {
        "code": "NOT_FOUND",
        "message": "The requested Ricardo resource was not found."
    },
    "success": false
}
503

Invalid Source Response

Ricardo answered with a response Scrappa could not read. This response is not billable.

{
    "error": {
        "code": "PARSER_DRIFT",
        "message": "Ricardo returned a response Scrappa could not read. Please retry later."
    },
    "success": false
}
503

Service Unavailable

The upstream service is temporarily unavailable. Please retry shortly.

{
    "error": {
        "code": "UPSTREAM_UNAVAILABLE",
        "message": "The Ricardo API is temporarily unavailable. Please retry."
    },
    "success": false
}

Generate Code with AI

Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.

Try It Live

Test this endpoint in our interactive playground with real data.