Skip to main content

ktemia

PyPI

The official Python client for the Ktemia travel search API. Search and compare flights, hotels, and rental cars across airlines, booking sites, and rental companies.

Ktemia searches and compares. It does not book: results carry links that hand off to the seller's own site.

  • Sync (Ktemia) and async (AsyncKtemia) clients with the same methods.
  • One call per search: starting a search and reading its first page happen together.
  • Catches bad input before sending, so a past date or a city name in a code field never spends quota.
  • Retries rate limits for you. Never retries a spent monthly quota.

Get a free API key · API reference · Getting started

Install

pip install ktemia
export KTEMIA_API_KEY=your-key

Usage

from ktemia import Ktemia

kt = Ktemia()  # reads KTEMIA_API_KEY

# Flights: IATA airport or city codes
page = kt.flights.search(origin="LAX", destination="LON", departureDate="2027-03-14")
for flight in page["flights"]:
    print(flight["id"], flight["bookingOptions"][0]["totalPrice"])

# Next page, then every seller and booking link for one result
more = kt.flights.page(page["nextToken"])
details = kt.flights.details(page["token"], page["flights"][0]["id"])

# Hotels and cars take a locationId from a lookup
loc = kt.lookup("hotelLocation", "Lisbon")
hotels = kt.hotels.search(location=loc["locations"][0]["locationId"], checkin="2027-03-14", checkout="2027-03-16")
reviews = kt.hotels.reviews(hotels["hotels"][0]["id"], sources=["booking"])

# Plan and remaining quota (free)
print(kt.key_status()["usage"])

Field names are the API's own (departureDate, pickupLocation, infantsOnLap); see the API reference for every field.

Async:

from ktemia import AsyncKtemia

async with AsyncKtemia() as kt:
    page = await kt.cars.search(pickupLocation="28501", pickupDate="2027-03-14", dropoffDate="2027-03-17")

Errors

Every failure raises KtemiaError with a stable code from the API (INVALID_ORIGIN, SEARCH_EXPIRED, QUOTA_EXCEEDED and so on), plus status, param, and retryable. Input rejected before sending raises KtemiaValidationError (code="INVALID_INPUT"), and no quota is spent. A search that matches nothing returns a page with noResults set instead of raising.

from ktemia import KtemiaError

try:
    kt.flights.search(origin="LAX", destination="LON", departureDate="2027-03-14")
except KtemiaError as error:
    if error.code == "QUOTA_EXCEEDED":
        ...  # the month's allowance is gone; retrying will not help

Agent frameworks

Source: Ktemiaa/ktemia-agent-toolkit. MIT licensed.

Metadata

Release files for ktemia 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ktemia 0.1.0
File Size Uploaded Provenance Actions
ktemia-0.1.0.tar.gz 33.5 kB With provenance Details for ktemia-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ktemia 0.1.0
File Interpreter ABI Platform Actions
ktemia-0.1.0-py3-none-any.whl Python 3 none any Details for ktemia-0.1.0-py3-none-any.whl

Total release size: 53.4 kB

Release files / ktemia-0.1.0.tar.gz

Download URL ktemia-0.1.0.tar.gz
Size 33.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9b2e135d8bb77d79dc100901c4f3919e16db4a451417bc4d8f25cf9d22fdeb0a
BLAKE2b-256 checksum
How to use checksums
51a7e534b20e7524af5fc3a840ad9cd5fac86cd8033fa3a2a2dd618fdfb7a995
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / ktemia-0.1.0-py3-none-any.whl

Download URL ktemia-0.1.0-py3-none-any.whl
Size 19.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e091f43728e352f29ef49f8695f3f579db14299517e0fd26588f16aa4cf2ea6
BLAKE2b-256 checksum
How to use checksums
f789d68f16f23e8529a2dec47f95d2493b72a90733161a14dffddeddf2d149f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for ktemia 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ktemia-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page