{
  "name": "Piratefly Flight Price Trends API",
  "description": "Free public API for flight price trends and popular destinations. Data is served from a 7-day cache (upstream Aviasales Data API), not live prices.",
  "endpoints": {
    "GET /api/v1/price-trends": "params: origin (required, IATA), currency (optional, default usd), destination (optional, IATA). Header X-Api-Key (Pro) bypasses the edge cache.",
    "GET /api/v1/analisi": "params: origine, destinazione (CITY names). Is today's fare cheap for this route, against its own price history. Same X-Api-Key. Free tier: 30 requests/day per IP. Proxied same-origin from next.piratefly.com — one domain to integrate.",
    "POST /api/v1/alerts": "body: { route: 'ORG-DST', email, threshold? }. Subscribe to a price-drop alert for a route.",
    "POST /api/v1/pro/checkout": "body: { email } -> { url }. Stripe Checkout for the Pro plan.",
    "POST /api/v1/pro/recupera": "body: { email }. Lost your key? A fresh one is emailed and the old one stops working."
  },
  "auth": "None for the free tier. Pro sends the key in the X-Api-Key header; the response carries X-Plan: pro and X-Cache: MISS. An unknown or revoked key gets 401, never a silent downgrade.",
  "cache": "Free GET responses are cached at the edge for 6 hours. Underlying data is refreshed by the upstream source on a 7-day cycle, so the free tier is not a live-price feed. Pro requests skip the edge cache.",
  "related": {
    "GET https://next.piratefly.com/v1/openapi.json": "OpenAPI 3.1 spec for the verdict API.",
    "GET https://next.piratefly.com/mcp": "MCP endpoint, for AI agents."
  },
  "license": "Free, no key required, fair use rate limits apply.",
  "pro": {
    "price": "from 9.99 USD/month (final price shown at checkout)",
    "includes": [
      "Live, uncached price lookups — send X-Api-Key and the 6-hour edge cache is bypassed for you",
      "Unlimited calls to the booking-verdict API (GET /api/v1/analisi) — the free tier stops at 30/day per IP",
      "The same key works on both APIs, and a lost key can be re-issued by email",
      "Email support, answered by a human"
    ],
    "page": "https://piratefly.com/api/",
    "checkout": "POST /api/v1/pro/checkout  body: { email }  -> { url } (Stripe Checkout)",
    "recover": "POST /api/v1/pro/recupera  body: { email }  -> lost your key? a new one is emailed to the address that pays, and the old one stops working. Same answer for any address, so this is not a way to find out who bought.",
    "subscribe": "https://shop.lumnika.com/piratefly-api.html?src=api-root"
  }
}