How to pull no. apprentice items using API in Apple Shortcuts?

I have managed to pull available reviews and available lessons as they are very straight forward to get. However, trying to count the number of apprentice level items appears to be much harder for me.

So far I have tried getting the content of “” then get the value of “data”. From what I can see this brings back all of the data per item so my next thought was to:

  • Count the initial length of “data” by character
  • Replace text for apprentice level (I believe apprentice is levels 1-4) with the same text minus the level, so the exact text to replace would be
    • “srs_stage”:1 > “srs_stage”:
    • “srs_stage”:2 > “srs_stage”:
    • “srs_stage”:3 > “srs_stage”:
    • “srs_stage”:4 > “srs_stage”:
  • Count new length of “data” by character

The result of the above script should be a count of all srs stage levels 1-4, however the number I am getting doesn’t reflect anything on my stats.

My current apprentice count is 43 however the above script returns 2.

does anyone have any better ideas of how I can get this to work in Apple Shortcuts please as I can’t seem to figure it out any other way.