Quickstart
-
Get a key. Sign up at the developer portal. Your account starts on the Free plan with a test key (
fapi_test_…). Copy it when it’s shown: keys are displayed once. -
Set two environment variables.
Terminal window export FIRMSAPI_URL=https://api.firmsapi.com/v1export FIRMSAPI_KEY=fapi_test_your_key_here -
Look up a code. E430 is Maher Terminal in Elizabeth, NJ.
Terminal window curl "$FIRMSAPI_URL/firms/E430" -H "x-api-key: $FIRMSAPI_KEY"const res = await fetch(`${process.env.FIRMSAPI_URL}/firms/E430`, {headers: { 'x-api-key': process.env.FIRMSAPI_KEY },});const body = await res.json();if (!res.ok) throw new Error(`${body.error.code}: ${body.error.message}`);console.log(body.data.name, body.meta.data_as_of);import osimport requestsres = requests.get(f"{os.environ['FIRMSAPI_URL']}/firms/E430",headers={"x-api-key": os.environ["FIRMSAPI_KEY"]},timeout=10,)body = res.json()res.raise_for_status()print(body["data"]["name"], body["meta"]["data_as_of"]) -
Search by name. Paperwork rarely has the code. Search takes free text:
Terminal window curl -G "$FIRMSAPI_URL/search" --data-urlencode "q=maher terminal elizabeth" \-H "x-api-key: $FIRMSAPI_KEY" -
Validate before you file. Check a code against the port on your filing and what you’re using it for:
Terminal window curl "$FIRMSAPI_URL/validate" -H "x-api-key: $FIRMSAPI_KEY" \-H "content-type: application/json" \-d '{"code": "E430", "port": "4601", "use": "location_of_goods"}'The response says whether the code is
validand listschecks_passed,checks_failedandchecks_not_possible: things public data can’t settle, such as bond status. See Validate before you file. -
Go live. Create a live key (
fapi_live_…) in the portal and swap it in. Nothing else changes.
Every response
Section titled “Every response”- JSON, under
/v1, authenticated with thex-api-keyheader. meta.data_as_of: the date of the CBP list the answer came from.meta.sourceandmeta.mode(liveortest).- Errors use one shape:
{"error": {"code": "...", "message": "...", "links": {...}}}. See errors.
- FIRMS codes explained: facility types, deleted codes and why a regex is the wrong check.
- API overview and the API reference: every endpoint and parameter.
- Plans and limits: prices, quotas and what counts as a call.