# No key neededbase="https://api.companyregistryapi.com"curl -sSG "$base/v1/search" \ --data-urlencode 'q=example' \ --data-urlencode 'address_country=FI'# Replace the placeholder with the matching id# from the search results.id="<company_id>"if [ "$id" != "<company_id>" ] && [ -n "$id" ]; then curl -sS --fail-with-body "$base/v1/companies/$id" && curl -sS "$base/v1/companies/$id/officers"fi
const base = "https://api.companyregistryapi.com";const search = await fetch( `${base}/v1/search?q=example&address_country=FI`,);const { data } = await search.json();if (!data.length) throw new Error("No match");const company = await fetch( `${base}/v1/companies/${data[0].id}`,);const body = await company.json();if (company.ok) { console.log(body.data.name ?? body.data.id);} else { console.log(`Error ${company.status}:`, body.detail);}
import requestsBASE = "https://api.companyregistryapi.com"params = {"q": "example", "address_country": "FI"}page = requests.get(f"{BASE}/v1/search", params).json()if not page["data"]: raise SystemExit("No match")company_id = page["data"][0]["id"]url = f"{BASE}/v1/companies/{company_id}"reply = requests.get(url)body = reply.json()if reply.ok: print(body["data"].get("name", company_id))else: print(f"Error {reply.status_code}:", body["detail"])