Code examples

Updated on 2. Dezember 2026

Every call of the API is a GET with one header. So every HTTP library works, and you do not need an SDK. The OpenAPI file lets you generate a client if you want one.

curl

Shell
$curl "https://api.firmiq.com/v1/companies/lookup?vat_number=ATU12345678" \
-H "Authorization: Bearer $FIRMIQ_KEY"

Python

A helper that sends the key, retries what can be retried, and raises on the rest (see errors, retries and rate limits):

Python
1import os, time, requests
2
3BASE = "https://api.firmiq.com/v1"
4session = requests.Session()
5session.headers["Authorization"] = f"Bearer {os.environ['FIRMIQ_KEY']}"
6
7def get(path, **params):
8 for attempt in range(4):
9 r = session.get(BASE + path, params=params, timeout=30)
10 if r.status_code == 429:
11 time.sleep(int(r.headers.get("Retry-After", "1")))
12 elif r.status_code == 503 and attempt < 3:
13 time.sleep(2 ** attempt)
14 else:
15 break
16 if r.status_code >= 400:
17 error = r.json()["error"]
18 raise RuntimeError(f"{r.status_code} {error['code']}: {error['message']}")
19 return r.json()
20
21company = get("/companies/lookup", vat_number="ATU12345678")
22print(company["id"], company["name"], company["status"])

Every page of a search:

Python
1def pages(path, **params):
2 while True:
3 page = get(path, **params)
4 yield from page["data"]
5 if page["next"] is None:
6 return
7 params["cursor"] = page["next"]
8
9for company in pages("/companies", country="AT", nace="28", revenue_min=10_000_000):
10 print(company["name"])

Node

JavaScript
1const BASE = "https://api.firmiq.com/v1";
2
3async function get(path, params = {}) {
4 const url = `${BASE}${path}?${new URLSearchParams(params)}`;
5 for (let attempt = 0; ; attempt++) {
6 const r = await fetch(url, { headers: { Authorization: `Bearer ${process.env.FIRMIQ_KEY}` } });
7 if (r.status === 429) await sleep(Number(r.headers.get("Retry-After") ?? 1) * 1000);
8 else if (r.status === 503 && attempt < 3) await sleep(2 ** attempt * 1000);
9 else if (!r.ok) throw new Error(`${r.status} ${(await r.json()).error.code}`);
10 else return r.json();
11 }
12}
13const sleep = (ms) => new Promise((done) => setTimeout(done, ms));
14
15const company = await get("/companies/lookup", { vat_number: "ATU12345678" });
16console.log(company.id, company.name, company.status);

Google Sheets

Open Extensions → Apps Script, paste the function, and put your key into the script properties as FIRMIQ_KEY (Project settings → Script properties). Then =FIRMIQ("ATU12345678") in a cell fills the row with the name, the status, the legal form, the city and the register number.

JavaScript
1function FIRMIQ(vatNumber) {
2 const key = PropertiesService.getScriptProperties().getProperty("FIRMIQ_KEY");
3 const r = UrlFetchApp.fetch(
4 "https://api.firmiq.com/v1/companies/lookup?vat_number=" + encodeURIComponent(vatNumber),
5 { headers: { Authorization: "Bearer " + key }, muteHttpExceptions: true },
6 );
7 if (r.getResponseCode() !== 200) return JSON.parse(r.getContentText()).error.code;
8 const c = JSON.parse(r.getContentText());
9 const seat = c.addresses.find((a) => a.valid_to === null) || {};
10 const home = c.registrations.find((x) => x.role === "home") || {};
11 return [[c.name, c.status, c.legal_form.name, seat.city, home.number]];
12}

A sheet recalculates often. That costs nothing extra: the same company is one request per month, however often you read it.

Need support?

Did this article not answer your question? Write to us.

Contact us