# FlixBus Station Autocomplete API Documentation

<p><strong>FlixBus Station Autocomplete API Documentation</strong> Find FlixBus and FlixTrain stations by name: id, numeric legacy id, name, street address, zip code, country, owning city, coordinates and train flag. Use the station id with the station endpoint.</p>

- **Documentation:** [https://scrappa.co/docs/flixbus-api/flixbus_stations](https://scrappa.co/docs/flixbus-api/flixbus_stations)
- **API group:** FlixBus API
- **Endpoint:** `GET https://scrappa.co/api/flixbus/stations`

## 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 or station name, 2 to 100 characters. Example: berlin. |

## Example response

```json
{
    "data": {
        "query": "berlin",
        "total": 3,
        "stations": [
            {
                "id": "17483554-a4a8-4dad-b940-b5f56740014f",
                "city": {
                    "id": "42d5ccaf-d0dc-4381-bd1f-9b5b38862cca",
                    "name": "Berlin Airport",
                    "slug": "berlin-airport",
                    "legacy_id": 127363
                },
                "name": "Berlin Airport BER, T 1/2",
                "slug": "berlin-airport-ber-p5",
                "score": 17.911556,
                "address": "Hugo-Junkers-Ring (Busparkplatz B)",
                "country": {
                    "code": "DE",
                    "name": "Germany"
                },
                "zipcode": "12529",
                "is_train": false,
                "location": {
                    "lat": 52.364540515813786,
                    "lon": 13.514171431931567
                },
                "legacy_id": 44061,
                "importance_order": 85
            },
            {
                "id": "dcbaaee6-9603-11e6-9066-549f350fcb0c",
                "city": {
                    "id": "40d8f682-8646-11e6-9066-549f350fcb0c",
                    "name": "Berlin",
                    "slug": "berlin",
                    "legacy_id": 88
                },
                "name": "Berlin central bus station",
                "slug": "berlin-zob",
                "score": 17.589495,
                "address": "Masurenallee 4-6",
                "country": {
                    "code": "DE",
                    "name": "Germany"
                },
                "zipcode": "14057",
                "is_train": false,
                "location": {
                    "lat": 52.507171,
                    "lon": 13.279399
                },
                "legacy_id": 1,
                "importance_order": 25
            },
            {
                "id": "394a5408-d778-4959-a63e-973253443ed2",
                "city": {
                    "id": "40d8f682-8646-11e6-9066-549f350fcb0c",
                    "name": "Berlin",
                    "slug": "berlin",
                    "legacy_id": 88
                },
                "name": "Berlin Central Station",
                "slug": "berlin-central-station-flixtrain",
                "score": 17.55965,
                "address": "Europaplatz 1",
                "country": {
                    "code": "DE",
                    "name": "Germany"
                },
                "zipcode": "10557",
                "is_train": true,
                "location": {
                    "lat": 52.525063,
                    "lon": 13.369438
                },
                "legacy_id": 20688,
                "importance_order": 24
            }
        ]
    },
    "meta": {
        "billable": true,
        "endpoint_family": "station_autocomplete"
    },
    "success": true
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A required query parameter is missing or invalid. This response is not billable. |
| 503 | Service Unavailable | FlixBus could not be reached 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)
