How do You Export Statistics? (is it Possible?)

I was wondering if it’s possible to periodically export statistics for each language. That would avoid to write them manually to create other charts.

I haven’t found any tool to export them. Is it possible?

Thanks.

EDIT: I add this screenshot.
Daily statistics to be exported in cvs to be added in excel or similar, so that we don’t have to enter them manually.

3 Likes

Hi Davide,

You can download the certificate which contains a lot of the statistics you might be looking for.

1 Like

Thanks James but certificates don’t have all the daily statistics that are available on LingQ. They just have some of them aggregated.

I want to know if we can download all the statistics provided by LingQ on a daily or weekly basis. So that we don’t have to enter them individually in a separate excel file.

I’ve updated above.

2 Likes

You can get the data via the LingQ API.
Here are your German stats for today:
https://www.lingq.com/api/v2/de/progress/?username=davideroccato&interval=today

Cards = LingQs. It also gives you your total numbers. You should be able to put this data into the format of your choice.

2 Likes

Thanks for this possibility.
I can see I can take the yesterday as well, and for any language. (I’ve started to fill in the morning the data for the day before).

I can see there are no coins in that statistic.

After that, I’m not really a programmer.

I want to step by step learn how to create charts with those statistics using “Numbers”.

I suppose that with this method, I should copy that string, paste it somewhere so that automatically would extrapolate some of those data to fill each day rows and columns.

Any suggestion would should I learn first?
Thanks.

There are countless possible ways to automate this process. I’m certainly not the right person to teach programming… If you have no experience, maybe start with the command line first and once you’re comfortable try to do the same thing in Python.

Here is a rough guide on how you might use curl (curl - How To Use) on the command line (terminal app) to connect to the LingQ server and get the data.

The first thing you need is your authorization token, which you can obtain here:

(You must not share it, as it gives access to your account.)

Here is an example command (replace the token):
curl ‘https://www.lingq.com/api/v2/de/progress/?username=davideroccato&interval=today
-H ‘Authorization: Token yoursecrettoken’
-H ‘accept: application/json’
–compressed \

output.txt

It should write the output to a text file.

For a start you can try around with that and explore all the other LingQ APIs as well.
When you want to graduate to programming you can look into the ‘requests’ library for Python. CSV is also well supported in Python. There are tons of tutorials online, in case of emergency ChatGPT can provide a boilerplate to get started.

As for numbers, I don’t know anything. But maybe it can be used in conjunction with the Automate or Shortcuts apps on macOS. Maybe worth exploring as well.

3 Likes

Thank you very much, I’ll bookmark everything. Just adding to the list. :smiley:

1 Like

We will see if exporting stats is something we can add as an option in the future. Thanks for your suggestion.

2 Likes

Thank you, that would be very helpful.

1 Like

Hello there, this is a minimal script that I made in 30 minutes that is functional but in need of customization. In the worst case I hope it can at least give you some hints on how to write yours (or hints on what not to do, lol).

https://bpa.st/RFADM

Usual disclaimer that I’m not responsible for what you may or may not end up doing to your machine, and as bamboozled said, be careful of not sharing your API key.

The way it works is by making a dataframe out of the json, then creating/appending the data to the excel file “stats.xlsx” (I tried csv but couldn’t make it work) with the suitable stats that you want to track. Ideally, once you have customized it, the next day you’ll just have to run the script to add the next column of data to the right. A picture:

You can see that the listening time is higher on the last one. That’s just me quickly testing that it works as intended (for the moment being).

2 Likes

@rafarafa: Thank you very much. I’ll add it to the other examples. It’ll be definitely useful for anybody that will want to create something similar.

Thanks. I’ve been looking for this for about a year.

Thank you for such useful detailed information. Exporting statistics, especially with an iPhone, can be complex for the common user, due to its interface and limited options. Additionally, And if at the same time it is also required transferring data from an old iPhone to a new one more adds to the complexity. To address these issues, utilizing a reliable source like https://setapp.com/how-to/how-to-transfer-data-to-a-new-iphone is essential. Their detailed guides simplify the process, making gadget usage more convenient and user-friendly.

I have a complicated macro to update the “words read today” number with a button press. It would be great to have this update automatically in a second window perhaps (or like the coins number). Google sheets import functions can’t get by the log in aspect.