# FlixBus API

> FlixBus returns dated bus trips, schedules, availability, and fares as a workflow and API.

FlixBus finds dated bus trips between two cities, including stops, local departure and arrival times, availability, and displayed per-person prices. Search bus trips needs an origin, destination, and local departure date; traveler count, currency, and maximum results are optional.

- Page: https://fous.com/workflows/flixbus
- Handle: `@flixbus`
- Category: [Travel](https://fous.com/workflows/category/travel)
- Source website: https://flixbus.com
- Last verified: Sep 29, 2026
- Fous is not affiliated with FlixBus.

## Methods

### Search bus trips

Operation `search_bus_trips`, version 1. 1 credit per call.

Find dated FlixBus trip options between two cities, with stops, local times, availability, and displayed per-person prices. Some routes also show partner operators; prices and seats may change at booking.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `date` | string | yes | `"2026-10-16"` | Local departure date, for example 2026-10-15. |
| `adults` | integer | no | `2` | Number of adult travelers, for example 2. |
| `origin` | string | yes | `"New York"` | Departure city, for example Berlin. |
| `currency` | string | no | `"USD"` | Three-letter fare currency, for example EUR. |
| `destination` | string | yes | `"Boston"` | Arrival city, for example Prague. |
| `max_results` | integer | no | `3` | Maximum trips to return, for example 20. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "origin",
    "destination",
    "date"
  ],
  "properties": {
    "date": {
      "type": "string",
      "format": "date",
      "description": "Local departure date, for example 2026-10-15.",
      "examples": [
        "2026-10-16",
        "2026-10-15"
      ]
    },
    "adults": {
      "type": "integer",
      "default": 1,
      "maximum": 9,
      "minimum": 1,
      "description": "Number of adult travelers, for example 2.",
      "examples": [
        2
      ]
    },
    "origin": {
      "type": "string",
      "title": "From",
      "minLength": 1,
      "description": "Departure city, for example Berlin.",
      "examples": [
        "New York",
        "Berlin"
      ]
    },
    "currency": {
      "type": "string",
      "default": "EUR",
      "pattern": "^[A-Za-z]{3}$",
      "description": "Three-letter fare currency, for example EUR.",
      "examples": [
        "USD"
      ]
    },
    "destination": {
      "type": "string",
      "title": "To",
      "minLength": 1,
      "description": "Arrival city, for example Prague.",
      "examples": [
        "Boston",
        "Prague"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 50,
      "minimum": 1,
      "description": "Maximum trips to return, for example 20.",
      "x-fous-developer": true,
      "examples": [
        3
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "date": "2026-10-16",
      "adults": 2,
      "origin": "New York",
      "currency": "USD",
      "destination": "Boston",
      "max_results": 3
    },
    {
      "date": "2026-10-15",
      "origin": "Berlin",
      "destination": "Prague"
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `trips` | array |  |  |
| `trips[].bookable` | boolean | `true` |  |
| `trips[].currency` | string | `"USD"` |  |
| `trips[].operator` | string | `"Greyhound"` |  |
| `trips[].page_link` | string | `"https://shop.flixbus.com/search?departureCity=c0a47c54-53ea-46dc-984b-b764fc0b2fa9&arrivalCity=eeff627f-2fda-4e75-8468-` |  |
| `trips[].transfers` | integer | `0` |  |
| `trips[].seats_left` | integer or null |  | Seats left at this price when shown. |
| `trips[].travel_time` | string | `"4h 30m"` |  |
| `trips[].arrival_stop` | string or null | `"Boston (South Station)"` |  |
| `trips[].arrival_time` | string | `"2026-10-16T05:30:00-04:00"` | Local ISO 8601 arrival time with offset. |
| `trips[].departure_stop` | string or null | `"New York Port Authority"` |  |
| `trips[].departure_time` | string | `"2026-10-16T01:00:00-04:00"` | Local ISO 8601 departure time with offset. |
| `trips[].arrival_stop_id` | string or null | `"9b6bfd56-3ecb-11ea-8017-02437075395e"` |  |
| `trips[].price_per_person` | number or null | `35.99` |  |
| `trips[].departure_stop_id` | string or null | `"e204bb66-8ab9-4437-8d0d-2b603cdf0c43"` |  |
| `search_link` | string | `"https://shop.flixbus.com/search?departureCity=c0a47c54-53ea-46dc-984b-b764fc0b2fa9&arrivalCity=eeff627f-2fda-4e75-8468-` |  |
| `origin_city_id` | string | `"c0a47c54-53ea-46dc-984b-b764fc0b2fa9"` |  |
| `destination_city_id` | string | `"eeff627f-2fda-4e75-8468-783d47955b3a"` |  |

**Example input**

```json
{
  "date": "2026-10-16",
  "adults": 2,
  "origin": "New York",
  "currency": "USD",
  "destination": "Boston",
  "max_results": 3
}
```

**Example output**

```json
{
  "trips": [
    {
      "bookable": true,
      "currency": "USD",
      "operator": "Greyhound",
      "page_link": "https://shop.flixbus.com/search?departureCity=c0a47c54-53ea-46dc-984b-b764fc0b2fa9&arrivalCity=eeff627f-2fda-4e75-8468-783d47955b3a&route=New+York%2C+NY-Boston%2C+MA&rideDate=16.10.2026&adult=2&_local…",
      "transfers": 0,
      "seats_left": null,
      "travel_time": "4h 30m",
      "arrival_stop": "Boston (South Station)",
      "arrival_time": "2026-10-16T05:30:00-04:00",
      "departure_stop": "New York Port Authority",
      "departure_time": "2026-10-16T01:00:00-04:00",
      "arrival_stop_id": "9b6bfd56-3ecb-11ea-8017-02437075395e",
      "price_per_person": 35.99,
      "departure_stop_id": "e204bb66-8ab9-4437-8d0d-2b603cdf0c43"
    },
    {
      "bookable": true,
      "currency": "USD",
      "operator": "Greyhound",
      "page_link": "https://shop.flixbus.com/search?departureCity=c0a47c54-53ea-46dc-984b-b764fc0b2fa9&arrivalCity=eeff627f-2fda-4e75-8468-783d47955b3a&route=New+York%2C+NY-Boston%2C+MA&rideDate=16.10.2026&adult=2&_local…",
      "transfers": 0,
      "seats_left": null,
      "travel_time": "4h 05m",
      "arrival_stop": "Boston (South Station)",
      "arrival_time": "2026-10-16T05:10:00-04:00",
      "departure_stop": "New York (GW Bridge)",
      "departure_time": "2026-10-16T01:05:00-04:00",
      "arrival_stop_id": "9b6bfd56-3ecb-11ea-8017-02437075395e",
      "price_per_person": 39.99,
      "departure_stop_id": "74b8f0dc-56a2-4d1b-b0a4-abe9df30a007"
    }
  ],
  "search_link": "https://shop.flixbus.com/search?departureCity=c0a47c54-53ea-46dc-984b-b764fc0b2fa9&arrivalCity=eeff627f-2fda-4e75-8468-783d47955b3a&route=New+York%2C+NY-Boston%2C+MA&rideDate=16.10.2026&adult=2&_local…",
  "origin_city_id": "c0a47c54-53ea-46dc-984b-b764fc0b2fa9",
  "destination_city_id": "eeff627f-2fda-4e75-8468-783d47955b3a"
}
```

## Quick start

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@flixbus",
  "visibility": "public",
  "operation": "search_bus_trips",
  "version": 1,
  "input": {
    "date": "2026-10-16",
    "adults": 2,
    "origin": "New York",
    "currency": "USD",
    "destination": "Boston",
    "max_results": 3
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

body = json.loads("{\n  \"api\": \"@flixbus\",\n  \"visibility\": \"public\",\n  \"operation\": \"search_bus_trips\",\n  \"version\": 1,\n  \"input\": {\n    \"date\": \"2026-10-16\",\n    \"adults\": 2,\n    \"origin\": \"New York\",\n    \"currency\": \"USD\",\n    \"destination\": \"Boston\",\n    \"max_results\": 3\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=120) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_000),
  body: JSON.stringify({
  "api": "@flixbus",
  "visibility": "public",
  "operation": "search_bus_trips",
  "version": 1,
  "input": {
    "date": "2026-10-16",
    "adults": 2,
    "origin": "New York",
    "currency": "USD",
    "destination": "Boston",
    "max_results": 3
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

Or describe the data in plain language: send `{"api":"@flixbus","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## Use cases

- Compare bus fares between cities
- Plan trips around departure and arrival times
- Check trip availability and seats left
- Review transfer counts and travel times
- Identify trip operators and stops

## FAQ

### Is Fous affiliated with FlixBus?

No. Fous is not affiliated with FlixBus. This workflow reads the public flixbus.com website and returns its data.

### How much does it cost?

Each run costs 1 credit. With pay-as-you-go, a credit costs 1¢; monthly plans cost less per credit.

### Do I need a FlixBus account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from flixbus.com when you run it; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check on Sep 29, 2026.

### What bus trips run between two cities on a date?

Search bus trips returns dated options between an origin and destination, with stops and local departure and arrival times.

### What is the displayed fare per person?

Search bus trips returns displayed per-person prices and their currency.

### How long is a trip, and are seats available?

Search bus trips returns travel time and, when shown, seats left at the displayed price.

## Related

- [All Travel workflows](https://fous.com/workflows/category/travel)
