# Wikicasa Agency Search API Documentation

Scrappa's `GET /api/wikicasa/agencies` lists the real estate agencies of one Italian city.

## What you get

`data.count` is the number of agencies, `data.items` holds the page. Each agency has `id`, `name`, `company_name`, `address`, `city`, `zip`, `phone`, `website`, `description`, `active_listings`, `visible_listings`, `premium`, `top_agency` and `prestigious`.

## How to use it

Take `city_id` from the autocomplete endpoint. Use an agency `id` with the agency, agents and listings endpoints. `limit` is 1 to 50, default 25.

- **Documentation:** [https://scrappa.co/docs/wikicasa-api/wikicasa_agencies](https://scrappa.co/docs/wikicasa-api/wikicasa_agencies)
- **API group:** Wikicasa API
- **Endpoint:** `GET https://scrappa.co/api/wikicasa/agencies`

## 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 |
| --- | --- | --- | --- |
| `city_id` | integer | Yes | Numeric city id from the autocomplete endpoint, for example 15146. |
| `page` | integer | No | Result page, 1-based. Default: 1. |
| `limit` | integer | No | Agencies per page, 1 to 50. Default: 25. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/wikicasa/agencies?city_id=15146&limit=10"
```

## Example response

```json
{
    "success": true,
    "data": {
        "count": 650,
        "items": [
            {
                "id": 17361,
                "name": "GIOIA BIANCHI",
                "company_name": "GIOIA BIANCHI",
                "url": "https://www.wikicasa.it/agenzia/gioia-bianchi-17361",
                "address": "CORSO INDIPENDENZA 24",
                "zip": "20129",
                "city": "Milano",
                "province": "Milano",
                "province_code": "MI",
                "latitude": 45.4675322,
                "longitude": 9.2155607,
                "phone": "02711852",
                "website": "https://www.gioiabianchi.com",
                "description": null,
                "active_listings": 8,
                "visible_listings": 8,
                "premium": true,
                "top_agency": false,
                "prestigious": false,
                "franchise_id": null,
                "image_id": 881112381
            }
        ]
    },
    "meta": {
        "endpoint_family": "agencies",
        "billable": true,
        "page": 1,
        "per_page": 10,
        "has_more": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing, unknown or unusable. Unknown parameters and unknown values are rejected, never ignored. Non-billable. |
| 503 | Upstream Unavailable | Wikicasa could not be reached, refused the request or answered with data this API could not read (`UPSTREAM_UNAVAILABLE`). Retryable and never billed. Clients are never rate limited. |

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