# TocToc Search API

<p><strong>TocToc Search API</strong> returns Chilean homes for sale or for rent as JSON, 20 per page by default. Send <code>region_id</code>, <code>commune_id</code> or both (use the autocomplete route to find them). Filter by property type, state, publisher type, agency, price in UF or pesos, bedrooms, bathrooms and useful area. Sort by relevance, price or publication date. Every item has the price in UF and pesos, rooms and area as numbers or <code>min</code> and <code>max</code> ranges, commune and region with <code>lat</code> and <code>lng</code>, up to 40 photos, the url, the publishing agency, offer data, views and publication age in hours.</p><p><strong>Filters are never ignored.</strong> A result that breaks a requested filter is refused as a whole with a 503 error. An item with an empty value for a requested filter, such as an unknown area, is not returned and is counted in <code>pagination.filtered_out</code>. A page is never labelled as another page. A page past the last one returns an empty list.</p><p><strong>Good to know.</strong> New projects show a range for rooms and area and a starting price. A filter matches a project when its range overlaps the filter. Failed requests are not billed.</p>

- **Documentation:** [https://scrappa.co/docs/toctoc-api/toctoc_search](https://scrappa.co/docs/toctoc-api/toctoc_search)
- **API group:** TocToc API
- **Endpoint:** `GET https://scrappa.co/api/toctoc/search`

## 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 |
| --- | --- | --- | --- |
| `operation` | string | No | sale (default) or rent. |
| `region_id` | integer | No | Region id from the autocomplete route. Send region_id, commune_id or both. |
| `commune_id` | integer | No | Commune id from the autocomplete route. |
| `property_type` | string | No | house, apartment, office, commercial, land, plot, storage or parking. |
| `state` | string | No | new or used. Sale only. |
| `publisher_type` | string | No | professional (brokers and developers) or private. |
| `agency` | string | No | Exact agency name as returned by the agencies route. A name with no exact match returns a 422 error. |
| `agency_type` | string | No | broker or developer. Only needed when a broker and a developer share one name. |
| `currency` | string | No | Currency of the price filter: uf (default for sale) or clp (default for rent). |
| `min_price` | number | No | Minimum price in the chosen currency. |
| `max_price` | number | No | Maximum price in the chosen currency. |
| `min_bedrooms` | integer | No | Minimum bedrooms. 0 is a studio. |
| `max_bedrooms` | integer | No | Maximum bedrooms. |
| `min_bathrooms` | integer | No | Minimum bathrooms. |
| `max_bathrooms` | integer | No | Maximum bathrooms. |
| `min_area` | number | No | Minimum useful area in square meters. |
| `max_area` | number | No | Maximum useful area in square meters. |
| `sort` | string | No | relevance (default), price_asc, price_desc, newest or oldest. |
| `page` | integer | No | One-based page number, 1 to 500 (default 1). |
| `limit` | integer | No | Listings per page, 1 to 50 (default 20). |

## Example response

```json
{
    "data": {
        "items": [
            {
                "id": 1982996,
                "url": "https://www.toctoc.com/venta/departamento/metropolitana/santiago/r_4061d7a340b5f34bf688ec6c1eb1475a8ef0f417",
                "badge": null,
                "offer": null,
                "price": {
                    "uf": 3125,
                    "clp": 128799281,
                    "listed_in": "UF"
                },
                "title": "Edificio Rosas 1444",
                "views": 0,
                "agency": {
                    "id": 59,
                    "logo": "https://d1cfu8v5n1wsm.cloudfront.net/toctoc/logos/empresa/59/2026082042328934803.jpg",
                    "name": "Euroinmobiliaria",
                    "type": "developer"
                },
                "images": [
                    "https://d1cfu8v5n1wsm.cloudfront.net/toctoc/fotos/20220330/1982996/2022033020268707763.jpg",
                    "https://d1cfu8v5n1wsm.cloudfront.net/toctoc/fotos/20220330/1982996/2022033023475177916.jpg",
                    "https://d1cfu8v5n1wsm.cloudfront.net/toctoc/fotos/20220330/1982996/2022033023481427853.jpg"
                ],
                "area_m2": {
                    "max": 49.33,
                    "min": 29
                },
                "hash_id": "4061d7a340b5f34bf688ec6c1eb1475a8ef0f417",
                "bedrooms": {
                    "max": 2,
                    "min": 1
                },
                "location": {
                    "region": "Metropolitana",
                    "commune": "Santiago",
                    "commune_id": 339,
                    "coordinates": {
                        "lat": -33.435794,
                        "lng": -70.6577694
                    }
                },
                "bathrooms": {
                    "max": 2,
                    "min": 1
                },
                "condition": "new",
                "operation": "Venta Nuevo",
                "main_image": "https://d1cfu8v5n1wsm.cloudfront.net/toctoc/fotos/20220330/1982996/2022033020268707763.jpg",
                "description": "Departamentos de 1 y 2 dormitorios con todas las bondades y beneficios de un edificio multifamily, con terminaciones de mayor calidad y durabilidad, amplios y c\u00f3modos espacios comunes y sistema de seguridad de alto nivel. - Piso porcelanato",
                "is_featured": false,
                "listing_type": "sale",
                "property_type": "Departamento",
                "published_hours_ago": 40101
            }
        ],
        "pagination": {
            "page": 1,
            "total": 6986,
            "per_page": 20,
            "total_pages": 350,
            "filtered_out": 0,
            "has_next_page": true
        },
        "applied_filters": {
            "sort": "relevance",
            "operation": "sale",
            "region_id": 13,
            "commune_id": 339,
            "property_type": "apartment"
        }
    },
    "meta": {
        "billable": true,
        "endpoint_family": "search"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A parameter is missing or invalid. This response is not billed. |
| 503 | Upstream Unavailable | TocToc could not be reached or returned data that does not match the request. This response is not billed and can be retried. |

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