# Homegate Locations API Documentation

Resolve Homegate locations by name (autocomplete) or by a comma-separated geo id list. Each result carries the id, type, multilingual names, url names, centre coordinates, child ids and the public search url. Feed url_names.en back into the search endpoint as the location parameter. Unknown ids answer a non-billable 404.

- **Documentation:** [https://scrappa.co/docs/homegate-api/homegate_locations](https://scrappa.co/docs/homegate-api/homegate_locations)
- **API group:** Homegate API
- **Endpoint:** `GET https://scrappa.co/api/homegate/locations`

## 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 |
| --- | --- | --- | --- |
| `name` | string | No | Search term (city, district or postal code). One of name or ids is required. Example: zurich. |
| `ids` | string | No | Comma-separated Homegate geo ids. Example: geo-city-zurich. |
| `lang` | string | No | Result language: de, en, fr or it. Defaults to en. |
| `from` | integer | No | Offset for name results. Defaults to 0. |
| `size` | integer | No | Results per page for name lookup. Defaults to 10. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/homegate/locations?name=zurich&lang=en&size=3"
```

## Example response

```json
{
    "success": true,
    "data": {
        "query": {
            "name": "zurich"
        },
        "pagination": {
            "from": 0,
            "size": 3,
            "total": 75
        },
        "results": [
            {
                "id": "geo-city-zurich",
                "type": "place",
                "names": {
                    "de": [
                        "Z\u00fcrich"
                    ],
                    "en": [
                        "Zurich"
                    ],
                    "fr": [
                        "Zurich"
                    ],
                    "it": [
                        "Zurigo"
                    ]
                },
                "url_names": {
                    "en": "city-zurich",
                    "de": "ort-zuerich",
                    "fr": "lieu-zurich",
                    "it": "luogo-zurigo"
                },
                "center": {
                    "lat": 47.377194615088676,
                    "lon": 8.539285808314094
                },
                "children": [
                    "geo-zipcode-8001",
                    "geo-zipcode-8002"
                ],
                "url": "https://www.homegate.ch/rent/real-estate/city-zurich/matching-list"
            }
        ]
    },
    "meta": {
        "endpoint_family": "locations",
        "billable": true
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | Neither name nor ids was supplied. This response is not billable. |
| 404 | Location Not Found | None of the supplied ids resolved to a location. This response is not billable. |
| 503 | Upstream Unavailable | Homegate is temporarily unreachable, blocked the request, or answered a shape we could not parse. Retry later; 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)
