Get a port and its facilities
const url = 'https://api.firmsapi.com/v1/ports/4601?include_deleted=false&limit=100';const options = {method: 'GET', headers: {'x-api-key': '<x-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.firmsapi.com/v1/ports/4601?include_deleted=false&limit=100' \ --header 'x-api-key: <x-api-key>'Facilities are ordered by code and paged with cursor. Placeholders are left out.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”4-digit CBP port code.
4-digit CBP port code.
Query Parameters
Section titled “ Query Parameters ”Include deleted codes (ranked after active ones).
Include deleted codes (ranked after active ones).
Responses
Section titled “ Responses ”OK
object
object
One page of the port’s facilities, ordered by code.
object
4-character FIRMS code.
Deleted codes stay in the data so you can tell why a filing failed.
object
True for “DO NOT USE” placeholders and CBP test records.
object
Items in data.
Example
{ "data": { "code": "4601", "facilities": [ { "code": "E430", "name": "MAHER TERMINAL", "status": "active", "type": { "code": "03", "label": "Pier or terminal" }, "port": { "code": "4601", "name": "Newark/Elizabeth" } } ] }, "meta": { "mode": "live" }}Invalid request (not counted).
object
object
Stable, machine-readable error code.
docs always; billing, buy_pack, upgrade when they help.
object
Example
{ "error": { "code": "quota_exceeded" }, "meta": { "mode": "live" }}Missing, invalid or revoked API key.
object
object
Stable, machine-readable error code.
docs always; billing, buy_pack, upgrade when they help.
object
Example
{ "error": { "code": "quota_exceeded" }, "meta": { "mode": "live" }}Not found (counted: it is a lookup result).
object
object
Stable, machine-readable error code.
docs always; billing, buy_pack, upgrade when they help.
object
Example
{ "error": { "code": "quota_exceeded" }, "meta": { "mode": "live" }}Monthly quota, call packs and overage cap used up (quota_exceeded).
object
object
Stable, machine-readable error code.
docs always; billing, buy_pack, upgrade when they help.
object
Example
{ "error": { "code": "quota_exceeded" }, "meta": { "mode": "live" }}