Habitica backup

Habitica is good for making habits
but it has one major shortcoming:
it does not save historical data.

This was a deal breaker for me,
as I want to be able to do data mining
on my own habit data later on.

After not using it for a while,
to day I got around to see
how to save the historical data myself.

Fortunately Habitica exposes an API,
so extracting the data for the current day is as easy as:

curl -X GET -H 'x-api-user: XXX' -H 'x-api-key: YYY' https://habitica.com/export/userdata.json

Which I added today to the crontab on my server,
appending it to a file every night,
so now I can switch the recording the habits
from my notes to Habitica again.