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 thedatacolumn (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:
- 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?
- 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?