A long time ago (in the API V1 era) there was a lot more detailed endpoint. I’ve tried using the wayback machine to find the docs for reference, but can’t find it so the best I have documentation for is my old Python code
data = self.get("https://www.wanikani.com/api/user/{}/srs-distribution")
levels = GaugeMetricFamily(
"wanikani_items", "Levels of current items", labels=["item", "level"]
)
totals = GaugeMetricFamily("wanikani_total", "Totals by type", labels=["item"])
for level, items in data["requested_information"].items():
for item, count in items.items():
if item == "total":
totals.add_metric([level], count)
else:
levels.add_metric([item, level], count)
This basically yielded something like
wanikani_total{item="radicals"} <count>
wanikani_total{item="kanji"} <count>
wanikani_total{item="vocab"} <count>
wanikani_items{item="radicals", level="apprentice"} <count>
wanikani_items{item="kanji", level="apprentice"} <count>
wanikani_items{item="vocab", level="apprentice"} <count>
wanikani_items{item="guru", level="apprentice"} <count>
Which I used to create some graphs of progress over time.
With the release of V2 (many years ago) a lot of these summary endpoints disappeared, and now you need to loop over assignments to build a same summary table
https://docs.api.wanikani.com/20170710/#assignments
Would it be possible to get an additional statistics api, to reduce the amount of api calls required client side, (and likely reduce server side load)
I would imagine something simple, that just returns a quick count of each of the types
{
"radicals":{<srs_level>: <srs_count>, ... }
"kanji":{0: 000, , 1: 111, 2:0, 3:333, ...}
"vocab":{<srs_level>: <srs_count> }
}
# Old SRS level names for reference
{
1: "apprentice",
2: "apprentice",
3: "apprentice",
4: "apprentice",
5: "guru",
6: "guru",
7: "master",
8: "enlightened",
9: "burned",
}