惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
雷峰网
雷峰网
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog
Y
Y Combinator Blog
WordPress大学
WordPress大学
Microsoft Azure Blog
Microsoft Azure Blog
小众软件
小众软件
G
Google Developers Blog
云风的 BLOG
云风的 BLOG
罗磊的独立博客
博客园 - 三生石上(FineUI控件)
博客园 - 叶小钗
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
量子位
The Cloudflare Blog
T
The Blog of Author Tim Ferriss
博客园_首页
B
Blog RSS Feed
Hugging Face - Blog
Hugging Face - Blog
IT之家
IT之家
阮一峰的网络日志
阮一峰的网络日志
L
LangChain Blog
宝玉的分享
宝玉的分享

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
How to Get a Free Skyscanner API Key and Search Live Flig...
Romina Duffy · 2026-04-27 · via DEV Community

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.