khan-academy

Internal APIs for getting access to Khan Academy Challenges


I am writing an app to integrate with Khan Academy, and I was wondering if anyone has figured out how to get the challenges that a learner has done?

For example, I have logged in and have done a couple of the challenges in the below programming playlist.

https://www.khanacademy.org/computing/computer-programming/programming

When I look at the page itself, it shows that some of the challenges marked as completed, however the Chrome developer console on the page itself doesn't show any XHR Api calls that pull that information down.

So has anyone found out which internal API is necessary to get which challenges have been done?


Per Ben Kraft's suggestion, I tried: '/api/v1/user/progress_summary?kind=Exercise' and got: {"started":[],"complete":["ex8e7aac0b"]}

Using: '/api/internal/user/kaid_688515334519823186196256/progress?dt_start=2017-08-15T00:00:00.000Z&dt_end=2018-08-25T00:00:00Z'

I got a lot of data, but I don't know what other parameters I can use to zero in on the information I want (challenges completed for the Intro to JS Course)


Solution

  • I think /api/v1/user/progress_summary is your best bet. I'm not sure why it's not listed on the API explorer, but here's the internal documentation:

    Return progress for a content type with started and completed lists.
    Takes a comma-separated `kind` param, like:
        /api/v1/user/progress_summary?kind=Video,Article
    and returns a dictionary that looks like:
        {"complete": ["a1314267931"], "started": []}
    

    (You'll also need to pass a user identifier like kaid, similar to other /api/v1/user routes.) Those IDs should match up with what you can get from the topic tree API, if you want more data on the individual content items. As far as I can tell that's exactly the same data we use on the topic pages.