# Introduction

One travel API for flights, hotels and car rentals: search, compare every seller’s price and get booking links. Examples in 7 languages and a free plan.

A travel API for search and compare: flights, hotels, and car rentals in one contract. Describe a trip and get the providers who can sell it, with prices. Booking stays with the provider.

Ktemia is a travel search API. You describe a trip for a person. The response is the providers who can sell it: airlines, agencies, and other sellers, with prices you can compare.

The API does not issue a ticket, take payment, or hold a reservation. When you open an offer, the response includes that provider’s URL. The person books on the provider’s site.

Choosing between providers first? [Travel APIs compared by who gives you a key](https://www.ktemia.com/blog/best-travel-api/) covers Amadeus, Skyscanner, Booking.com Demand, Expedia Rapid, CarTrawler, and Ktemia.

## Flights API

Turn a place into an airport or city code with [Search airports](https://www.ktemia.com/docs/api/flights/airports/) and an airline name into a code with [Search airlines](https://www.ktemia.com/docs/api/flights/airlines/). Search one-way, round trip, or multi-city with 2 to 6 legs, and get every seller’s fare with a booking link. Start with the [flight search API](https://www.ktemia.com/docs/api/flights/search/).

## Hotel API

Turn a city, neighbourhood, or property name into a location id, search by dates and guests, and compare every booking site’s price for each hotel, with guest reviews. Start with the [hotel API](https://www.ktemia.com/docs/api/hotels/search/).

## Car rental API

Find a pickup location, search by dates, and compare rental companies and booking sites for each car. Narrow results to named rental companies with `agencies`. Start with the [car rental API](https://www.ktemia.com/docs/api/cars/search/).

## Base URL

Every request goes to `https://api.ktemia.com`. There is no version prefix. The API is HTTPS only.

Send JSON, and you get JSON back. A search is `POST` with a body. A read that follows a search is `GET` with query parameters.

## Providers

Each offer names the provider and the price, so you can show a person the choices side by side. The booking link opens that provider’s site with the trip filled in. Leave the URL as the API returned it.

To get data from one provider only, filter the search: `airlines` on flights, `providers` on hotels and cars, and `agencies` on cars. [Providers](https://www.ktemia.com/providers/) lists every airline, booking site, and rental company we have seen, with the id to send.

Look up an airport or city code with [Search airports](https://www.ktemia.com/docs/api/flights/airports/), and an airline code with [Search airlines](https://www.ktemia.com/docs/api/flights/airlines/). Then start a flight search at [Search flights](https://www.ktemia.com/docs/api/flights/search/). For a car hire, look up a place with [Search locations](https://www.ktemia.com/docs/api/cars/locations/), then start at [Search cars](https://www.ktemia.com/docs/api/cars/search/). For a stay, look up a place with [Search locations](https://www.ktemia.com/docs/api/hotels/locations/), then start at [Search hotels](https://www.ktemia.com/docs/api/hotels/search/). Authentication, errors, and pagination are the sections below. They apply to every call.

## Read more

How Ktemia compares with other travel APIs, by who can get a key: [best travel API in 2026](https://www.ktemia.com/blog/best-travel-api/). Why a search API is not a GDS or a booking engine: [GDS vs booking engine vs a search API](https://www.ktemia.com/blog/search-api-vs-gds-booking-engine/). Search from Claude Code, Cursor, or Codex with the open-source [Ktemia skills](https://github.com/Ktemiaa/ktemia-skills) (`flight-search`, `car-search`, `hotel-search`): `/plugin marketplace add Ktemiaa/ktemia-skills`, then `/plugin install ktemia@ktemia`.

## Authentication

Every request requires an API key. Create one in the [dashboard](https://app.ktemia.com), then send it on every call.

### The header

Pass `X-API-Key: <your key>`. A missing key answers `401 MISSING_API_KEY`. A bad key answers `401 INVALID_API_KEY`. Both include `{"success": false, "error": {"code", "message"}, "data": null}`.

Keys are secrets. Keep them in an environment variable on a server. The playground on this site keeps a key in this browser tab so you can try a call. Do not put a key in the JavaScript of your own app.

### HTTPS only

The API is HTTPS only. Call it from your server. This site’s playground is allowed to call it from the browser; other websites are not.

## Errors

Success responses are the JSON shown on each endpoint. Errors use one shape: a missing key, a bad body, an empty search, an expired token.

### The envelope

`error.code` is stable and uppercase. `error.message` is safe to show. `error.param` is the field to highlight when the input was wrong (`departureDate`, `legs[1].date`, `airlines[0]`). It is omitted when the failure is not about a field.

Unknown fields are rejected. The response names the field in `error.param`.

### Status codes

`400` - the request is malformed (`MISSING_FIELD`, `TRIP_CONFLICT`, `INVALID_ORIGIN`, `INVALID_LOCATION`, `LEGS_OUT_OF_ORDER`, `INVALID_SEARCH_TOKEN`, …).

`401` - missing or invalid API key.

`404` - `NO_RESULTS` on search (the trip is valid, nothing published), or `NO_MORE_RESULTS` on a page past the end.

`410` - `SEARCH_EXPIRED`. The token was valid and is now gone. Start a new search; retrying this one will not help.

`429` - rate limit or a temporary block after repeated auth failures. Honour `Retry-After`.

`502` - `SEARCH_FAILED`, `DETAILS_FAILED`, `AIRPORTS_UNAVAILABLE`, `AIRLINES_UNAVAILABLE`, `LOCATIONS_UNAVAILABLE`, `REVIEWS_UNAVAILABLE`, or `UPSTREAM_ERROR`. Temporary. Retry the same request.

## Pagination

Each search is fixed for 60 minutes. `/flights/results`, `/cars/results`, and `/hotels/results` read the next page of that search. Page 2 does not repeat page 1. Hotel reviews are separate: they take a hotel id and do not expire with the search.

### Tokens, not page numbers

`/flights/search`, `/cars/search`, and `/hotels/search` return `searchToken` for page 1. Each results response that is not the last page includes `nextToken`. Send that as the `token` query parameter. Flights and cars return 20 per page. Hotels return up to 30. You cannot request a page by number. Hotel reviews are the exception: `/hotels/reviews` takes `page`, 10 reviews at a time.

A token that is not valid answers `400 INVALID_SEARCH_TOKEN`. A token that has expired answers `410 SEARCH_EXPIRED`. Start a new search.

### totalResults

`totalResults` is how many itineraries, cars, or hotels the search contains. `hasMore` is true when another page exists. The last page omits `nextToken`. Requesting a page after that returns `404 NO_MORE_RESULTS`.

Docs: https://www.ktemia.com/docs/api/
