Find out more about our new API Documentation
The OpenLearning API uses HTTP and JSON to make it easy to access and manipulate OpenLearning data. The API uses HTTP Basic Authentication for an OpenLearning user or any existing session cookie.
This API is not designed for creating interactive apps that are embedded into OpenLearning, it should instead be used for downloading and manipulating data via external scripts.
We request that you do not release software which asks users for their OpenLearning credentials.
Activity Blocks Client-Side API
https://www.openlearning.com/api/users/newbie - If you're logged in, this will download a file called output.json with the data. If you're not logged in it will prompt you for HTTP Basic Authentication.
The following command line tools can be used to experiment with the API.
curl -u username:password https://www.openlearning.com/api/users/newbie - curl. Use -i to see the HTTP response codes, if you get a blank response.
wget -O- --user username --password password https://www.openlearning.com/api/users/newbie - wget.
lwp-request -C username:password https://www.openlearning.com/api/users/newbie - lwp-request.
Python with requests
This example shows how to access the API from a python script, using the python requests library.
1. #!/usr/bin/python 2. import requests, json 3. authentication = ('username', 'password') 4. url = 'https://openlearning.com/api/users/newbie' 5. response = requests.get(url, auth=authentication) 6. print json.loads(response.content)
The following pages demonstrate the various OpenLearning API's currently available for use. These pages will be progressively updated with new API's as they become available.