DEV Community

Cover image for How to Get a Free Skyscanner API Key and Search Live Flights (Node.js + Python)
Romina Duffy
Romina Duffy

Posted on • Originally published at apihiver.com

How to Get a Free Skyscanner API Key and Search Live Flights (Node.js + Python)

If you've ever searched for flights on Skyscanner and thought "I need this data in my app", the first thing you'll discover is that the official Skyscanner API is closed — it's only available to approved travel partners, not independent developers.

The good news: the same Skyscanner flight search data is available through a managed helper API on RapidAPI, with a free tier you can start using today. This tutorial walks you through getting a free Skyscanner API key, making your first flight search, and building on top of the results — with complete working code in Node.js and Python.

What you'll build: A script that takes a departure airport, destination, and travel date and returns live Skyscanner flight results as structured JSON — ready to render in your own UI.

Why the official Skyscanner API is hard to get

Skyscanner runs a partner programme for travel agencies, meta-search engines, and OTAs. If you're an established travel business, you can apply for direct API access. The process involves a business review, a commercial agreement, and production credentials that typically take weeks — not something you can sign up for and use today.

For developers who need Skyscanner flight data now — for a side project, a price tracker, an affiliate site, or a proof of concept — the practical route is the Sky Scrapper API on RapidAPI: a managed service that handles the data aggregation and returns clean JSON, with a free tier and no partner agreement required.

Step 1 — Get your free Skyscanner API key

A "Skyscanner API key" for independent developers means a RapidAPI key that grants access to the Sky Scrapper API:

  1. Go to rapidapi.com and create a free account
  2. Search for Sky Scrapper or go directly to rapidapi.com/apiheya/api/sky-scrapper
  3. Click Subscribe to Test and select the BASIC plan (free, no credit card)
  4. Copy your X-RapidAPI-Key from the code-snippets panel

That key works for every API on RapidAPI — so if you later need Google Flights data, hotel rates, or weather, the same key works.

Step 2 — Your first Skyscanner API call

The Sky Scrapper API is a standard HTTP REST API. Send a GET request with your key in the headers, get JSON back:

curl --request GET \
  --url 'https://sky-scrapper.p.rapidapi.com/api/v1/flights/searchFlights?originSkyId=LOND&destinationSkyId=NYCA&originEntityId=27544008&destinationEntityId=27537542&date=2026-06-15&adults=1&currency=USD&countryCode=US&market=en-US' \
  --header 'X-RapidAPI-Host: sky-scrapper.p.rapidapi.com' \
  --header 'X-RapidAPI-Key: YOUR_RAPIDAPI_KEY'
Enter fullscreen mode Exit fullscreen mode

Response:

{
  "status": true,
  "data": {
    "itineraries": [
      {
        "price": { "raw": 289.0, "formatted": "$289" },
        "legs": [
          {
            "origin": { "id": "LHR", "name": "London Heathrow" },
            "destination": { "id": "JFK", "name": "New York JFK" },
            "durationInMinutes": 425,
            "stopCount": 0,
            "departure": "2026-06-15T10:10:00",
            "arrival": "2026-06-15T13:15:00",
            "carriers": {
              "marketing": [{ "name": "British Airways" }]
            }
          }
        ]
      }
    ]
  }
}
Enter fullscreen mode Exit fullscreen mode

Important: originSkyId / destinationSkyId are Skyscanner's own city-level codes (LOND, NYCA) — not IATA codes (LHR, JFK). Always resolve city names via /searchAirport first.

Key endpoints

Endpoint What it does
/api/v1/flights/searchAirport Search airports by keyword — returns skyId and entityId
/api/v1/flights/searchFlights One-way or round-trip flight search
/api/v1/flights/getPriceCalendar Cheapest fare per day across a date range
/api/v1/flights/getFlightDetails Full detail for a specific itinerary
/api/v1/hotels/searchHotels Hotel search (same API key)
/api/v1/cars/searchCars Car hire search (same API key)

Node.js example — one-way flight search

// npm install node-fetch
import fetch from "node-fetch";

const RAPIDAPI_KEY = process.env.RAPIDAPI_KEY;
const HOST = "sky-scrapper.p.rapidapi.com";
const HEADERS = {
  "X-RapidAPI-Key": RAPIDAPI_KEY,
  "X-RapidAPI-Host": HOST
};

async function searchAirport(query) {
  const url = new URL("https://" + HOST + "/api/v1/flights/searchAirport");
  url.searchParams.set("query", query);
  url.searchParams.set("locale", "en-US");

  const res = await fetch(url, { headers: HEADERS });
  const { data } = await res.json();
  return data[0];
}

async function searchFlights({ from, to, date }) {
  const url = new URL("https://" + HOST + "/api/v1/flights/searchFlights");
  url.searchParams.set("originSkyId", from.skyId);
  url.searchParams.set("destinationSkyId", to.skyId);
  url.searchParams.set("originEntityId", from.entityId);
  url.searchParams.set("destinationEntityId", to.entityId);
  url.searchParams.set("date", date);
  url.searchParams.set("adults", "1");
  url.searchParams.set("currency", "USD");
  url.searchParams.set("market", "en-US");
  url.searchParams.set("countryCode", "US");

  const res = await fetch(url, { headers: HEADERS });
  if (!res.ok) throw new Error("Skyscanner API error: " + res.status);
  const { data } = await res.json();
  return data.itineraries;
}

const [origin, destination] = await Promise.all([
  searchAirport("London"),
  searchAirport("New York")
]);

const flights = await searchFlights({
  from: origin,
  to: destination,
  date: "2026-07-10"
});

for (const f of flights.slice(0, 5)) {
  const leg = f.legs[0];
  console.log(f.price.formatted + " - " + leg.carriers.marketing[0].name + " - " + leg.stopCount + " stop(s)");
}
Enter fullscreen mode Exit fullscreen mode

Python example — price calendar (cheapest dates)

import os
import requests

HOST = "sky-scrapper.p.rapidapi.com"
HEADERS = {
    "X-RapidAPI-Key": os.environ["RAPIDAPI_KEY"],
    "X-RapidAPI-Host": HOST,
}

def search_airport(query):
    r = requests.get(
        "https://" + HOST + "/api/v1/flights/searchAirport",
        headers=HEADERS,
        params={"query": query, "locale": "en-US"},
        timeout=10,
    )
    r.raise_for_status()
    return r.json()["data"][0]

def price_calendar(origin, destination, year_month):
    r = requests.get(
        "https://" + HOST + "/api/v1/flights/getPriceCalendar",
        headers=HEADERS,
        params={
            "originSkyId": origin["skyId"],
            "destinationSkyId": destination["skyId"],
            "originEntityId": origin["entityId"],
            "destinationEntityId": destination["entityId"],
            "yearMonth": year_month,
            "currency": "USD",
        },
        timeout=15,
    )
    r.raise_for_status()
    return r.json()["data"]["flights"]["days"]

origin = search_airport("London Heathrow")
destination = search_airport("Paris CDG")
days = price_calendar(origin, destination, "2026-08")

for day in sorted(days, key=lambda d: d["price"])[:5]:
    print(day["day"], "->", "$" + str(day["price"]))
Enter fullscreen mode Exit fullscreen mode

Common mistakes to avoid

  • Hardcoding skyId values — always resolve via searchAirport. They can change.
  • No timeout set — live searches take 3-8 seconds. Set a 15-second minimum timeout.
  • No caching — cache results per (origin, destination, date) for 5-15 minutes.
  • Empty itineraries — means no inventory on that route/date, not an API failure. Use getPriceCalendar to suggest nearby dates.

Pricing

Plan Price Requests/month
BASIC Free 100
PRO $10 ~5,000
ULTRA $30 ~30,000
MEGA $100 ~200,000

The free tier is enough to fully test and validate your integration. PRO is the right starting point for a production side project.


Originally published at apihiver.com — where we test and document developer APIs.

Top comments (0)