Skip to content

Quickstart

  1. 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.

  2. Set two environment variables.

    Terminal window
    export FIRMSAPI_URL=https://api.firmsapi.com/v1
    export FIRMSAPI_KEY=fapi_test_your_key_here
  3. Look up a code. E430 is Maher Terminal in Elizabeth, NJ.

    Terminal window
    curl "$FIRMSAPI_URL/firms/E430" -H "x-api-key: $FIRMSAPI_KEY"
  4. 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"
  5. 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 valid and lists checks_passed, checks_failed and checks_not_possible: things public data can’t settle, such as bond status. See Validate before you file.

  6. Go live. Create a live key (fapi_live_…) in the portal and swap it in. Nothing else changes.

  • JSON, under /v1, authenticated with the x-api-key header.
  • meta.data_as_of: the date of the CBP list the answer came from.
  • meta.source and meta.mode (live or test).
  • Errors use one shape: {"error": {"code": "...", "message": "...", "links": {...}}}. See errors.