npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@f3rr1gn0/ryanair-sdk

v1.0.0

Published

Ryanair API client with rate-limited got wrapper and Zod validation.

Downloads

20

Readme

Ryanair SDK

NPM version License GitHub Build Status Code coverage Top language Postman Collection

Inspired by the punchy docs of 2bad — this package wraps Ryanair's public endpoints with sane defaults, blazing-fast validation, and test-friendly ergonomics.

Fork notice: This repository is a maintained fork of 2BAD/ryanair with rewritten JavaScript output, expanded testing, and additional documentation.

Highlights

  • Typed by design via Zod schemas without TypeScript runtime overhead.
  • Drop-in HTTP client powered by got with smart, globally queued debouncing.
  • Rich helpers for airports, fares, flights, routing, and geo math.
  • Ready for prod: dual CJS/ESM bundles, full test coverage, MIT licensed.

Installation

npm install @f3rr1gn0/ryanair-sdk
# or
pnpm add @f3rr1gn0/ryanair-sdk

The package ships compiled artifacts under dist/; no build step is required after installation.

Quick start

ES module

import { airports, fares, flights } from '@f3rr1gn0/ryanair-sdk';

const run = async () => {
  const active = await airports.getActive();
  const cheapest = await fares.findCheapestRoundTrip('DUB', 'KRK', '2024-05-01', '2024-05-31');
  const availability = await flights.getAvailable({ Origin: 'DUB', Destination: 'KRK' });

  console.log(active.length, cheapest[0], availability.trips[0].dates[0].flights.length);
  // Example output: 253 { departure: {...}, return: {...}, price: 45 } 6
};

run();

CommonJS

const { airports, fares, flights } = require('@f3rr1gn0/ryanair-sdk');

async function run() {
  const active = await airports.getActive();
  const cheapest = await fares.findCheapestRoundTrip('DUB', 'KRK', '2024-05-01', '2024-05-31');
  const availability = await flights.getAvailable({ Origin: 'DUB', Destination: 'KRK' });

  console.log(active.length, cheapest[0], availability.trips[0].dates[0].flights.length);
  // Example output: 253 { departure: {...}, return: {...}, price: 45 } 6
}

run();

Custom HTTP client

ES module override

import { setHttpClient, resetHttpClient } from '@f3rr1gn0/ryanair-sdk/client';
import got from 'got';

setHttpClient(
  got.extend({
    hooks: {
      beforeRequest: [({ url }) => console.info('->', url.toString())],
    },
  }),
);

// ... make SDK calls here

resetHttpClient();

CommonJS override

const { setHttpClient, resetHttpClient } = require('@f3rr1gn0/ryanair-sdk/client');
const got = require('got');

setHttpClient(
  got.extend({
    hooks: {
      beforeRequest: [({ url }) => console.info('->', url.toString())],
    },
  }),
);

// ... make SDK calls here

resetHttpClient();

Modules at a glance

  • airports: active airports, geo search, route discovery, schedules, and Zod schemas.
  • fares: fare calendars, round-trip combinatorics (via fast-cartesian), and price helpers.
  • flights: booking availability + date lookup with strongly validated payloads.
  • helpers: dates, coordinates, pricing utilities, and haversine distance calculations.
  • client: lazy got factory with global debouncing and injectable overrides.
  • endpoints: frozen base URLs for Ryanair public APIs.

Every response is validated on the fly; invalid data throws early with precise error messages.

Testing and coverage

The suite is powered by Vitest (v8 engine coverage). Run it locally:

npm test

Coverage thresholds are enforced at ≥90 percent for statements/lines/functions and ≥85 percent for branches. HTML and JSON summaries are emitted in coverage/.

Want to iterate? npm run test:watch keeps the feedback loop tight.

Build and publish

npm run build   # bundles to dist/index.{js,cjs}
npm pack        # optional: preview the tarball destined for npm

A prepare lifecycle hook rebuilds automatically so the packaged tarball always ships fresh artifacts. Add a remote and push to make it public:

git init
git remote add origin [email protected]:f3rr1gn0/ryanair-sdk.git
npm version patch
npm publish --access public

API Overview

Airports API

  • Get active airports list
  • Find nearest airports
  • Discover available destinations
  • View airport details
  • Search flight routes

View Airports Documentation →

Fares API

  • Find cheapest daily fares
  • Compare prices across date ranges
  • Discover best round-trip deals
  • Search by currency preference

View Fares Documentation →

Flights API

  • Check flight availability
  • View flight schedules
  • Search available dates
  • Access flight details

View Flights Documentation →

Understanding IATA Codes

IATA codes are three-letter identifiers used in aviation for airports worldwide. For example:

  • DUB - Dublin Airport
  • BER - Berlin Brandenburg Airport
  • STN - London Stansted Airport

Find the complete list on IATA's official website.

Disclaimer

This is an unofficial package and is not affiliated with Ryanair. Usage is subject to Ryanair's API terms and conditions.

Contributing

Contributions are welcome. Here's how you can help:

  1. Fork the repository
  2. Create a feature branch
  3. Submit a pull request

Please ensure your code passes all tests and follows our coding standards.

License

MIT © f3rr1gn0


Need help? Open an issue or check our Postman collection.