Keep your database in sync

Updated on 2. Dezember 2026

You loaded companies into your own database, from an export or through the API. Registers change every day. This guide keeps your copy current.

The idea

List changes returns every event FirmIQ recorded since a moment, the oldest first, for all companies. You remember where you stopped, and ask from there the next time. You do not read companies that did not change.

1. Read the changes since your last run

Shell
$curl "https://api.firmiq.com/v1/changes?since=2026-11-30T00:00:00Z&country=AT,DE&limit=100" \
-H "Authorization: Bearer $FIRMIQ_KEY"
JSON
1{
2 "data": [
3 {
4 "company": { "id": "0b6f3c1e-…", "name": "Alpenblick Maschinenbau GmbH" },
5 "type": "officer_appointed",
6 "effective_on": "2026-11-24",
7 "registered_on": "2026-11-27",
8 "published_on": "2026-11-30",
9 "recorded_at": "2026-11-30T05:14:02Z",
10 "summary": "Thomas Gruber appointed as managing director",
11 "source": { "code": "at_evi", "document": "sha256:b20c5d…", "retrieved_at": "2026-11-30T05:02:44Z" }
12 }
13 ],
14 "next": "eyJvIjoxMDB9"
15}

Follow next with cursor until it is null. Filter with country and type so that you only get what you hold: the event types are in event types.

2. Apply each change

Two ways, and you can mix them:

  • Read the company again. For each company.id in the page that you hold, call retrieve a company and replace your copy. This is the safe way: you never have to understand an event. Several events of one company are one read.
  • Apply the event. If you only track one thing, such as the status, take it from the event and do not read the company. type says what happened; summary says it in a sentence.

Skip the ids you do not hold.

3. Remember where you stopped

Store the recorded_at of the last change you applied, and send it as since the next time. Changes are sorted by recorded_at, the moment FirmIQ stored them, and not by the day they took effect: a register can publish a change weeks after its date. So a since by recorded_at never misses one.

since is inclusive. You get the last change of the run before a second time; applying a change twice must do no harm.

4. Handle merges and hidden companies

When you read a company again, two answers need their own handling:

  • 410 merged: two records were one company. Replace your id with error.id; see which id to store.
  • 451 hidden: the data was hidden on request. Delete your copy.

How often

Once a day is enough for most uses: the registers themselves publish once a day, and how often sources update says when. Run it more often if you need a change within the hour.

After a gap

If your job did not run for a week, do nothing special: the next run asks with the old since and reads a longer list. After a very long gap, or when you are not sure what you missed, a new export is the cheaper way to start again.

What it costs

A change in the list counts as a request of its company, as any read of that company does, and once per month. Reading the company afterwards is then free. The filters decide the cost: ask for the countries and event types that you use.

Need support?

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

Contact us