SDKs
The official JavaScript and Python clients
One client for the Google Flights, Booking.com, Airbnb and Google Hotels APIs, on your own RapidAPI key. Four namespaces, one method per endpoint, the X-Search-* headers read for you, and one error type that carries the HTTP status and the search status. Open source, MIT, on GitHub.
Install
One package per language
Both packages have the same surface. Neither has runtime dependencies.
npm install flightpowersUses the global fetch (Node 18+, browsers, Deno, Bun). ESM and CommonJS builds, TypeScript types included. flightpowers on npm
pip install flightpowersPython 3.9+, standard library only, type hints included. flightpowers on PyPI
Quickstart
A live one-way fare in five lines
Subscribe to the listing you need on RapidAPI and put your key in RAPIDAPI_KEY. One key works on every listing you subscribe to.
import { FlightPowers } from "flightpowers";
const fp = new FlightPowers({ rapidApiKey: process.env.RAPIDAPI_KEY! });
const { data, meta } = await fp.flights.oneway({ from_airport: "JFK", to_airport: "LHR", departure_date: "2027-01-20" });
console.log(meta.searchStatus, data[0]?.price, data[0]?.price_range_in_relation_to_other_periods);
console.log(data[0]?.buy_link);import os
from flightpowers import FlightPowers
fp = FlightPowers(os.environ["RAPIDAPI_KEY"])
res = fp.flights.oneway(from_airport="JFK", to_airport="LHR", departure_date="2027-01-20")
print(res.meta.search_status)Every method takes the API’s own field names and returns data, status, meta and headers. meta.searchStatus (Python: meta.search_status) is ok, empty, partial or degraded: empty means the search finished and there is nothing, degraded means it did not finish, so an empty list says nothing about availability (search status). Any non-2xx answer raises FlightPowersError. Retries are off by default.
Methods
Four namespaces, one method per endpoint
| API | JavaScript / TypeScript | Python |
|---|---|---|
| Google Flights | fp.flights.oneway fp.flights.roundtrip fp.flights.onewayMultiAirport fp.flights.roundtripMultiAirport | fp.flights.oneway fp.flights.roundtrip fp.flights.oneway_multi_airport fp.flights.roundtrip_multi_airport |
| Booking.com | fp.booking.search fp.booking.hotelByName fp.booking.resolve fp.booking.rooms | fp.booking.search fp.booking.hotel_by_name fp.booking.resolve fp.booking.rooms |
| Airbnb | fp.airbnb.search fp.airbnb.details | fp.airbnb.search fp.airbnb.details |
| Google Hotels | fp.googleHotels.search fp.googleHotels.rates | fp.google_hotels.search fp.google_hotels.rates |
The full options, response fields, errors and retries are in each package’s README on github.com/mtnrabi/flightpowers-sdk. Flights, Booking.com, Airbnb and Google Hotels are separate RapidAPI subscriptions; plans, quotas and rate limits are on the pricing page.