Skip to content

Firms

Search and count trade firms (importers or exporters).

All requests require the X-API-KEY and X-SIGNATURE headers. See Authentication.


POST /api/v1/firms/search

Search for firms matching the specified filter criteria. Returns a paginated list of firm records.

Request Body

FieldTypeRequiredConstraintsDescription
pageintegerYesmin: 1Page number to retrieve
account_namestringNoAccount context for this request
importer_countriesarray[string]Nomax 10 itemsISO country codes to filter by importer country. Defaults to ["ALL"] if omitted
exporter_countriesarray[string]Nomax 10 itemsISO country codes to filter by exporter country; requires at least one other parameter
hs_codesarray[string]Nomax 10 items; numeric characters onlyHS codes to filter by
start_datestringNoformat: yyyy-MM-ddStart of shipment date range
end_datestringNoformat: yyyy-MM-ddEnd of shipment date range
firm_filterarray[integer]NoFirm type codes to filter by
search_typestringNo"importer" or "exporter"Trade direction to search
product_detailstringNomin 3 charsProduct description keyword
exporter_firmstringNomin 3 charsExporter firm name keyword
importer_firmstringNomin 3 charsImporter firm name keyword
brand_namestringNomin 3 charsBrand name keyword
arrival_portstringNomin 3 charsPort of arrival keyword
departure_portstringNomin 3 charsPort of departure keyword

At least one filter parameter is required. exporter_countries requires at least one additional parameter. NOT-operator parameters cannot be used without a positive parameter.

Response

FieldTypeDescription
total_shipmentintegerTotal shipment records matching the query
total_pagesintegerTotal number of pages available
pageintegerCurrent page number
firms_countintegerNumber of firms returned in this page
firmsarray[Firm]List of firm records

Example

js
import crypto from 'crypto'

const payload = JSON.stringify({
  page: 1,
  search_type: 'importer',
  importer_countries: ['US', 'DE'],
  hs_codes: ['847130'],
  start_date: '2024-01-01',
  end_date: '2024-12-31'
})

const signature = crypto
  .createHmac('sha256', 'your-api-secret')
  .update(payload)
  .digest('base64')

const res = await fetch('https://apiv2.tradeatlas.com/api/v1/firms/search', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-KEY': 'your-api-key',
    'X-SIGNATURE': signature
  },
  body: payload
})
const data = await res.json()
bash
PAYLOAD='{"page":1,"search_type":"importer","importer_countries":["US","DE"],"hs_codes":["847130"],"start_date":"2024-01-01","end_date":"2024-12-31"}'

SIGNATURE=$(echo -n "$PAYLOAD" | openssl dgst -sha256 -hmac "your-api-secret" -binary | base64)

curl -X POST https://apiv2.tradeatlas.com/api/v1/firms/search \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your-api-key" \
  -H "X-SIGNATURE: $SIGNATURE" \
  -d "$PAYLOAD"
java
String payload = "{\"page\":1,\"search_type\":\"importer\",\"importer_countries\":[\"US\",\"DE\"],\"hs_codes\":[\"847130\"],\"start_date\":\"2024-01-01\",\"end_date\":\"2024-12-31\"}";

Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec("your-api-secret".getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
String signature = Base64.getEncoder()
    .encodeToString(mac.doFinal(payload.getBytes(StandardCharsets.UTF_8)));

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://apiv2.tradeatlas.com/api/v1/firms/search"))
    .header("Content-Type", "application/json")
    .header("X-API-KEY", "your-api-key")
    .header("X-SIGNATURE", signature)
    .POST(HttpRequest.BodyPublishers.ofString(payload))
    .build();

HttpResponse<String> response = HttpClient.newHttpClient()
    .send(request, HttpResponse.BodyHandlers.ofString());
python
import hmac, hashlib, base64, requests

payload = '{"page":1,"search_type":"importer","importer_countries":["US","DE"],"hs_codes":["847130"],"start_date":"2024-01-01","end_date":"2024-12-31"}'

signature = base64.b64encode(
    hmac.new("your-api-secret".encode(), payload.encode(), hashlib.sha256).digest()
).decode()

response = requests.post(
    "https://apiv2.tradeatlas.com/api/v1/firms/search",
    headers={
        "Content-Type": "application/json",
        "X-API-KEY": "your-api-key",
        "X-SIGNATURE": signature,
    },
    data=payload,
)
data = response.json()

Response

json
{
  "total_shipment": 15420,
  "total_pages": 31,
  "page": 1,
  "firms_count": 500,
  "firms": [
    {
      "country": "United States",
      "country_code": "US",
      "name": "Tech Imports LLC",
      "address": "123 Commerce St, New York, NY 10001",
      "city_state": "New York, NY",
      "tel": "+1 212 555 0100",
      "e_mail": "[email protected]",
      "web": "www.techimports.example.com",
      "firm_type": 1,
      "shipment_count": 42
    }
  ]
}

POST /api/v1/firms/count

Count firms matching the specified filter criteria.

Request Body

Accepts the same filter fields as /api/v1/firms/search, without the page field.

FieldTypeRequiredConstraintsDescription
account_namestringNoAccount context for this request
importer_countriesarray[string]Nomax 10 itemsISO country codes to filter by importer country
exporter_countriesarray[string]Nomax 10 itemsISO country codes to filter by exporter country
hs_codesarray[string]Nomax 10 items; numeric onlyHS codes to filter by
start_datestringNoformat: yyyy-MM-ddStart of shipment date range
end_datestringNoformat: yyyy-MM-ddEnd of shipment date range
firm_filterarray[integer]NoFirm type codes to filter by
search_typestringNo"importer" or "exporter"Trade direction to search
product_detailstringNomin 3 charsProduct description keyword
exporter_firmstringNomin 3 charsExporter firm name keyword
importer_firmstringNomin 3 charsImporter firm name keyword
brand_namestringNomin 3 charsBrand name keyword
arrival_portstringNomin 3 charsPort of arrival keyword
departure_portstringNomin 3 charsPort of departure keyword

Response

FieldTypeDescription
firm_countintegerTotal number of firms matching the query

Example

js
import crypto from 'crypto'

const payload = JSON.stringify({
  search_type: 'exporter',
  exporter_countries: ['CN', 'IN'],
  hs_codes: ['847130'],
  start_date: '2024-01-01',
  end_date: '2024-12-31'
})

const signature = crypto
  .createHmac('sha256', 'your-api-secret')
  .update(payload)
  .digest('base64')

const res = await fetch('https://apiv2.tradeatlas.com/api/v1/firms/count', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-KEY': 'your-api-key',
    'X-SIGNATURE': signature
  },
  body: payload
})
const data = await res.json()
bash
PAYLOAD='{"search_type":"exporter","exporter_countries":["CN","IN"],"hs_codes":["847130"],"start_date":"2024-01-01","end_date":"2024-12-31"}'

SIGNATURE=$(echo -n "$PAYLOAD" | openssl dgst -sha256 -hmac "your-api-secret" -binary | base64)

curl -X POST https://apiv2.tradeatlas.com/api/v1/firms/count \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: your-api-key" \
  -H "X-SIGNATURE: $SIGNATURE" \
  -d "$PAYLOAD"
java
String payload = "{\"search_type\":\"exporter\",\"exporter_countries\":[\"CN\",\"IN\"],\"hs_codes\":[\"847130\"],\"start_date\":\"2024-01-01\",\"end_date\":\"2024-12-31\"}";

Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec("your-api-secret".getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
String signature = Base64.getEncoder()
    .encodeToString(mac.doFinal(payload.getBytes(StandardCharsets.UTF_8)));

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://apiv2.tradeatlas.com/api/v1/firms/count"))
    .header("Content-Type", "application/json")
    .header("X-API-KEY", "your-api-key")
    .header("X-SIGNATURE", signature)
    .POST(HttpRequest.BodyPublishers.ofString(payload))
    .build();

HttpResponse<String> response = HttpClient.newHttpClient()
    .send(request, HttpResponse.BodyHandlers.ofString());
python
import hmac, hashlib, base64, requests

payload = '{"search_type":"exporter","exporter_countries":["CN","IN"],"hs_codes":["847130"],"start_date":"2024-01-01","end_date":"2024-12-31"}'

signature = base64.b64encode(
    hmac.new("your-api-secret".encode(), payload.encode(), hashlib.sha256).digest()
).decode()

response = requests.post(
    "https://apiv2.tradeatlas.com/api/v1/firms/count",
    headers={
        "Content-Type": "application/json",
        "X-API-KEY": "your-api-key",
        "X-SIGNATURE": signature,
    },
    data=payload,
)
data = response.json()

Response

json
{
  "firm_count": 1284
}

Nexus Backend API Dokümantasyonu