5

How can I get the articles of a topic through the Khan Academy API? I can see how it works with exercises and videos, but what about articles?

For example the query

http://www.khanacademy.org/api/v1/topic/beginners-art-history

returns the contents of the page

https://www.khanacademy.org/humanities/art-history-basics/beginners-art-history/

How can I get the content of the article "A brief history of Western culture" inside it?

4

1 回答 1

3

一篇文章的正确 API 调用是:

http://www.khanacademy.org/api/v1/articles/%s

在主题 API 调用返回的 JSON 中,为上述 %s 使用“child_data”数组中的“id”(文章具有值为“article”的“kind”条目。)

(您也可以使用“child_data”数组中的“id”在“children”数组中查找对应的“internal_id”来获取文章的一些基本信息,例如标题和描述。)

所以对于你的主题电话,

http://www.khanacademy.org/api/v1/topic/beginners-art-history

你得到 id "1314267931" 然后打电话

http://www.khanacademy.org/api/v1/articles/1314267931

于 2016-12-04T19:42:07.423 回答