Taginfo Chronology database: how to work with it?

I would like to retrieve historical usage of several hundreds of keys since their first use until present time. I know this information can be retrieved through taginfo’s /api/4/key/chronology , but since I’d need to run mulitple queries, I would not want to abuse the resources.

Instead, I am planning to get that data from the database dump taginfo-chronology.db.bz2 . I didn’t find the metadata for that database, but I am pretty certain this is the one I’m looking for. However, when I explore it, I can see a table called keys_chronology which seems to be the one I’m looking for. It contains the following columns:

  • key: containing the name of the keys. there are no repeated keys, which makes me think that data associated to them is nested in the data column (see below).
  • data (BLOB)
  • first_use : number,
  • smoothness: empty

I believe what I’m looking for is in data column, which I’d imagine/hope that it is a nested/serialised data for each key, but I’m not sure.

Now, considering that I’m a total noob with SQL, my questions are:

  1. How could I query the local database and export the data for a given key into a CSV? Conversely, how could I create a new table that has a long format where I can see the key being queried, the date and number of uses per date?
  2. If 2 was not possible and I were to query the API, are there any recommendations you’d make so I do not abuse the resources?

sleep few seconds between API calls, sleep few minutes ii received HTTP 429 “Too Many Requests” or similar

check whether taginfo has usage policy

Thanks for the suggestion

For the record, and in case someone has this issue in the future:
I got an answer from taginfo’s developer, Jochen Topf, stating that the data is in a BLOB to make the storage more efficient and that the code for decoding it is this one: taginfo/web/lib/utils.rb at master · taginfo/taginfo · GitHub