Developer guide

From zero to your first NSN lookup

JSON over HTTPS. One header for your key. No SDK needed.

Quick start

  1. Get a key

    Choose a plan on the pricing page. The Free plan is enough to follow this guide. Keys look like nsn_ followed by 48 letters and digits.

  2. Look up an NSN

    Send your key in the X-Api-Key header. The NSN can have dashes or not, or be a 9-character NIIN.

    curl -H "X-Api-Key: $KEY" \
      "https://api.nsnlookup.com/v19/nsn/5305-00-123-4567?include=references,management"
    import requests
    
    r = requests.get(
        "https://api.nsnlookup.com/v19/nsn/5305-00-123-4567",
        headers={"X-Api-Key": KEY},
        params={"include": "references,management"},
        timeout=30,
    )
    if r.status_code == 404:
        print("No such NSN")
    else:
        r.raise_for_status()
        item = r.json()
        print(item["nsn"], item.get("itemName"))
    using var http = new HttpClient { BaseAddress = new Uri("https://api.nsnlookup.com") };
    http.DefaultRequestHeaders.Add("X-Api-Key", key);
    
    var item = await http.GetFromJsonAsync<JsonElement>(
        "/v19/nsn/5305-00-123-4567?include=references,management");
    
    Console.WriteLine(item.GetProperty("itemName").GetString());
    const res = await fetch(
      "https://api.nsnlookup.com/v19/nsn/5305-00-123-4567?include=references,management",
      { headers: { "X-Api-Key": process.env.NSN_API_KEY } }
    );
    if (!res.ok) throw new Error((await res.json()).error);
    const item = await res.json();
    console.log(item.nsn, item.itemName);
    
    // Call from your server, not from a web page: a key in browser code is public.
    $item = Invoke-RestMethod "https://api.nsnlookup.com/v19/nsn/5305-00-123-4567?include=references" `
        -Headers @{ 'X-Api-Key' = $key }
    $item.itemName
    $item.references | Format-Table partNumber, cage, rncc
  3. Read the answer

    Properties are camelCase. A property with no value is left out. Every field is explained in the data dictionary.

    {
      "nsn": "5305-00-123-4567",
      "niin": "001234567",
      "fsc": "5305",
      "itemName": "SCREW,MACHINE",
      "demil": "A",
      "references": [
        { "partNumber": "MS35338-44", "cage": "96906", "rncc": "2", "rnvc": "2", "historical": false }
      ],
      "management": [
        { "moe": "DS", "unitOfIssue": "HD", "unitPrice": 12.34, "aac": "D", "effectiveDate": "2025-10-01" }
      ]
    }

    Sample values for illustration, not a real catalog record.

Endpoints

Base address https://api.nsnlookup.com. All are GET and return JSON.

EndpointWhat it returns
/v19/nsn/{nsn}One NSN record. Add ?include= for more sections
/v19/search?q=NSNs matching an item name, NSN or exact part number. Optional fsc, page, pageSize
/v19/parts?partNumber=NSNs that list a manufacturer part number. Optional cage
/v19/cage/{code}The company behind a CAGE code
/v19/cage?q=Companies matching a name
/v19/fsc/{code}A Federal Supply Class: title and scope notes
/v19/inc/{code}An Item Name Code: approved name and definition

Sections you can add to an NSN record

Ask only for what you need: ?include=references,management. Use all for everything.

SectionContents
referencesManufacturer part numbers and CAGE codes (included by default)
managementUnit price, unit of issue, source of supply, acquisition advice code, by service
characteristicsDecoded characteristics such as material and dimensions
moeRulesWhich services and agencies use and manage the item
standardizationStandardization decisions and replacement NSNs
cancellationsCancelled or replaced NIINs
freightFreight classification
packagingPackaging requirements

Errors

Every error is JSON with a stable error code and a readable message. Test the code, not the wording.

400The request is malformed, for example invalid_nsn
401Missing or wrong key
404No such NSN, CAGE, FSC or INC. A normal answer, not a fault
429Over your plan's limit. Wait the seconds in Retry-After
503Briefly unavailable. Retry after Retry-After

Versioning

The version is in the address: /v19/. Once a version is published, calls written for it keep working.

  • New optional fields and endpoints can appear in a version. Ignore fields you do not know.
  • Nothing is renamed, removed or retyped inside a version.
  • A breaking change becomes a new version beside the old one.
  • GET /versions lists every version and its status.

Good habits

  • Keep the key on your server. Never put it in a web page or a mobile app.
  • Cache what you look up. Catalog data changes monthly, so yesterday's answer is almost always still right.
  • Treat "missing" as "blank". Empty catalog fields are left out of the response.
  • Retry politely. Retry 429 and 503 after the Retry-After delay. Do not retry 400, 401 or 404.

Stuck, or need a field we do not return?

Tell us what you are building. A real person on the NSN Lookup team answers developer questions.

Ask a developer question Full API reference