This is the code and notes from my live Twitch programming and drawing classes.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

20 lines
381 B

import requests
from pprint import pprint
import sys
import csv
api_url = "http://learncodethehardway.com/api/course"
# list all courses
r = requests.get(api_url)
data = r.json()
pprint(data)
# get one course, full=true includes all modules
r = requests.get(api_url, params={
"course_id": 1, "full": "true" })
data = r.json()
pprint(data)
# remember with? use it with csv