Getting started

1. Get an API key

Every data call needs an API key. Keys look like nsn_ followed by 48 letters and digits. Request one from NSN Lookup. Keep it secret: anyone holding your key can spend your request allowance.

2. Send the key with each request

Use either header. Both work on every endpoint, including MCP.

X-Api-Key: nsn_your_key_here
Authorization: Bearer nsn_your_key_here

Keys in the URL (?api_key=...) are ignored on purpose, so a key never ends up in logs or browser history.

3. Look up an NSN

curl -H "X-Api-Key: $KEY" "https://api.nsnlookup.com/v19/nsn/5305-00-123-4567"

The NSN can be written with or without dashes (5305001234567), or as the 9-character NIIN (001234567).

Ask for more detail with include:

curl -H "X-Api-Key: $KEY" "https://api.nsnlookup.com/v19/nsn/5305-00-123-4567?include=references,management,characteristics"

By item name:

curl -H "X-Api-Key: $KEY" "https://api.nsnlookup.com/v19/search?q=screw+machine&fsc=5305"

By manufacturer part number:

curl -H "X-Api-Key: $KEY" "https://api.nsnlookup.com/v19/parts?partNumber=MS35338-44"

Code samples

Python:

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"))

C#:

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");

PowerShell:

Invoke-RestMethod "https://api.nsnlookup.com/v19/nsn/5305-00-123-4567" -Headers @{ 'X-Api-Key' = $key }

Good habits