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

faa-nms-api

v1.0.3

Published

A fully typed, robust, and zero-dependency Node.js/TypeScript client for the Federal Aviation Administration (FAA) NOTAM Management System (NMS) API.

Downloads

965

Readme

npm version TypeScript License: MIT


🛠️ Features

Interacting with the FAA NMS API traditionally requires manual OAuth 2.0 client_credentials token management, complex URL parameters handling, and dealing with undocumented type structures.

This library handles all the heavy lifting:

  • 🚀 Zero Dependencies: Built entirely on top of native Node.js fetch.
  • 🔒 Smart Authentication: Fully automatic and lazy token refreshing. Never worry about expired Bearer tokens.
  • 🏷️ 100% Typed: Strict TypeScript mappings directly derived from the official FAA OpenAPI specification.
  • 🌍 Multi-Environment Support: Switch between production, staging, and fit effortlessly.

📑 Table of Contents


📦 Installation

Install the package via your favorite package manager. (Requires Node.js 18+ for native fetch support).

npm install faa-nms-api
# or
yarn add faa-nms-api
# or
pnpm add faa-nms-api

🔑 Getting API Access

To obtain your API credentials (clientId and clientSecret), you must request access from the FAA by sending an email to [email protected].


🚀 Quick Start

Here is a minimal example of how to fetch NOTAMs for a specific airport in GeoJSON format.

import { NmsClient } from 'faa-nms-api';

// 1. Initialize the client
const faaClient = new NmsClient({
    clientId: process.env.FAA_CLIENT_ID!,
    clientSecret: process.env.FAA_CLIENT_SECRET!,
    environment: 'production'
});

// 2. Fetch data (Tokens are generated automatically in the background)
async function run() {
    try {
        const response = await faaClient.getFilteredNotams('GEOJSON', {
            location: 'JFK',
            radius: 50
        });

        console.log(`Found ${response.data.geojson?.length} NOTAMs.`);
    } catch (error) {
        console.error('Failed to fetch data:', error);
    }
}

run();

⚙️ Client Configuration

When instantiating the NmsClient, you must pass an NmsClientOptions object:

| Property | Type | Required | Default | Description | |---|---|---|---|---| | clientId | string | Yes | - | Your FAA NMS API Client ID. | | clientSecret | string | Yes | - | Your FAA NMS API Client Secret. | | environment | 'production' \| 'staging' \| 'fit' | No | 'production' | Target FAA Environment. |


📖 API Reference

All methods are asynchronous and return Promises containing exact TypeScript interfaces mapping to the FAA OpenAPI spec.

1. getFilteredNotams

Search NOTAMs with advanced filters.

function getFilteredNotams(
    nmsResponseFormat: 'AIXM' | 'GEOJSON', 
    params?: NmsSearchParams
): Promise<NmsNotamResponse | NmsInitialLoadResponse>

Optional Parameters (params):

  • location (e.g., 'DFW', 'KDFW')
  • classification ('DOMESTIC', 'INTERNATIONAL', 'FDC', 'MILITARY', 'LOCAL_MILITARY')
  • feature ('RWY', 'TWY', 'APRON', 'AIRSPACE', etc.)
  • nmsId (Exact 16-digit NOTAM ID)
  • radius, latitude, longitude (Must be used together)
  • accountability, effectiveStartDate, effectiveEndDate, lastUpdatedDate, freeText, notamNumber

2. getNotamsChecklist

Fetch lightweight NOTAM checklists (used for quick diffs).

function getNotamsChecklist(params?: {
    accountability?: string;
    classification?: NotamClassification;
    location?: string;
}): Promise<NmsChecklistResponse>

3. getLocationSeries

Retrieve Location-Series data, useful to see what changed since a specific date.

function getLocationSeries(params?: { 
    lastUpdatedDate?: string 
}): Promise<NmsLocationSeriesResponse>

4. getInitialLoad

Retrieve a temporary URL to download a highly compressed dump of all active NOTAMs across the NAS.

function getInitialLoad(params?: { 
    allowRedirect?: boolean 
}): Promise<NmsInitialLoadResponse | Response>

5. getInitialLoadByClassification

Retrieve a compressed global load, filtered by a specific classification.

function getInitialLoadByClassification(
    classification: NotamClassification, 
    params?: { allowRedirect?: boolean }
): Promise<NmsInitialLoadResponse | Response>

6. getContent

Proxies access to download binary content files (streams) returned by the Initial Load endpoints.

function getContent(token: string): Promise<Response>

🧩 Exported Types

The package exports all TypeScript interfaces directly from the FAA specification. You can import them to strongly type your own application:

import type { 
    NmsNotamResponse, 
    NotamClassification, 
    NotamFeature,
    NmsEnvironment
} from 'faa-nms-api';

const myClass: NotamClassification = 'DOMESTIC';

🛡️ Error Handling

If the FAA API rejects the request (e.g., invalid parameters, unauthorized, or server outages), the client throws a native JavaScript Error. You should catch these in your application.

try {
    await faaClient.getFilteredNotams('GEOJSON', { radius: -5 }); // Invalid!
} catch (error) {
    if (error instanceof Error) {
        console.error('FAA API Error:', error.message);
        // "NMS API request failed: 400 Bad Request - {"timestamp": "...", "status": "400", "message": "Bad Request"}"
    }
}

📜 License

This project is licensed under the MIT License.