# Omio Places API Documentation

<p><strong>Omio Places API Documentation</strong> Find cities, train stations, bus stations and airports by a search text. Each place has a position_id, a type (location, station, busstation or airport), names in several forms, country, coordinates, time zone and, for cities, the number of train stations, bus stations and airports plus the main child stations. Use the position_id of a place as origin_id or destination_id in the search and summary endpoints. Pass id to resolve one place, and departure_id to list destinations that are served from that departure place.</p>

- **Documentation:** [https://scrappa.co/docs/omio-api/omio_places](https://scrappa.co/docs/omio-api/omio_places)
- **API group:** Omio API
- **Endpoint:** `GET https://scrappa.co/api/omio/places`

## 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 |
| --- | --- | --- | --- |
| `query` | string | Yes | City, station or airport name, 2 to 100 characters. Example: berlin. Required unless id is set. |
| `id` | integer | No | Position id of one place to resolve, instead of a search text. Example: 376217. |
| `departure_id` | integer | No | Position id of the departure place. Limits the results to places that can be reached from it. |
| `locale` | string | No | Language of the names: en, de, fr, es, it, nl, pt or pl. Defaults to en. |

## Example response

```json
{
    "data": {
        "id": null,
        "query": "Berlin",
        "results": [
            {
                "name": "Berlin",
                "type": "location",
                "score": 5728.8696,
                "children": [
                    {
                        "name": "Berlin Hbf",
                        "type": "station",
                        "score": 20.294334,
                        "latitude": 52.525102698597905,
                        "city_code": null,
                        "city_name": "Berlin",
                        "in_europe": null,
                        "longitude": 13.369429982803336,
                        "time_zone": "Europe/Berlin",
                        "population": 100,
                        "position_id": 334196,
                        "country_code": "DE",
                        "country_name": "Germany",
                        "default_name": "Berlin Hbf",
                        "search_volume": null,
                        "canonical_name": "Berlin-Hauptbahnhof",
                        "location_position_id": 376217
                    },
                    {
                        "name": "Berlin-Gesundbrunnen station",
                        "type": "station",
                        "score": 3.5462298,
                        "latitude": 52.54875223068328,
                        "city_code": null,
                        "city_name": "Berlin",
                        "in_europe": null,
                        "longitude": 13.388952535345538,
                        "time_zone": "Europe/Berlin",
                        "population": 100,
                        "position_id": 334167,
                        "country_code": "DE",
                        "country_name": "Germany",
                        "default_name": "Berlin Gesundbrunnen",
                        "search_volume": null,
                        "canonical_name": "Berlin-Gesundbrunnen-Germany",
                        "location_position_id": 376217
                    },
                    {
                        "name": "Berlin Spandau",
                        "type": "station",
                        "score": 1.3655626,
                        "latitude": 52.53447,
                        "city_code": null,
                        "city_name": "Berlin",
                        "in_europe": null,
                        "longitude": 13.19753,
                        "time_zone": "Europe/Berlin",
                        "population": 100,
                        "position_id": 334098,
                        "country_code": "DE",
                        "country_name": "Germany",
                        "default_name": "Berlin Spandau",
                        "search_volume": null,
                        "canonical_name": "Berlin-Spandau",
                        "location_position_id": 376217
                    }
                ],
                "latitude": 52.52437,
                "city_code": "BER",
                "city_name": "Berlin",
                "in_europe": null,
                "longitude": 13.41053,
                "time_zone": "Europe/Berlin",
                "population": 100,
                "position_id": 376217,
                "country_code": "DE",
                "country_name": "Germany",
                "default_name": "Berlin",
                "search_volume": null,
                "canonical_name": "Berlin",
                "station_counts": {
                    "airports": 1,
                    "bus_stations": 18,
                    "train_stations": 160,
                    "ferry_terminals": 0
                },
                "location_position_id": 376217
            },
            {
                "name": "Berlin, CT",
                "type": "location",
                "score": 1.2142584,
                "children": [],
                "latitude": 41.621488,
                "city_code": null,
                "city_name": "Berlin",
                "in_europe": null,
                "longitude": -72.7456519,
                "time_zone": "America/New_York",
                "population": 19866,
                "position_id": 16894579,
                "country_code": "US",
                "country_name": "USA",
                "default_name": "Berlin",
                "search_volume": null,
                "canonical_name": "Berlin-CT-USA",
                "location_position_id": 16894579
            }
        ],
        "results_count": 2
    },
    "meta": {
        "billable": true,
        "endpoint_family": "place_autocomplete"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required parameter is missing or invalid. This response is not billable. |
| 404 | Resource Not Found | The search, trip or route was not found or has expired. This response is not billable. |
| 503 | Service Unavailable | Omio could not be reached, did not finish the search in time, or answered with an unexpected shape. 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)
