Skip to content
API documentation and Examples
Branch: master
Clone or download
vyahhi Merge pull request #63 from xamgore/patch-2
Latest commit 9d164d9 Jan 18, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples Merge pull request #63 from xamgore/patch-2 Jan 18, 2019
tests tests moved Jun 22, 2016
.travis.yml docs and examples v1 May 12, 2016 rename it, sorry about that Aug 19, 2016
LICENSE rename it, sorry about that Aug 19, 2016
requirements.txt upgrade requests Nov 13, 2018 API Readme has REST API in JSON format. API endpoints are listed on, and you can also make API call there (but this page is limited to GET requests). use the same API for its web front-end (JS app) and its iOS/Android applications. Therefore, almost all the platform features are supported in this API.

All API examples are up to date and working if the build status is passing: Build Status


Stepik API schema is flat, i.e. there are no nested end-points.

Every request returns a list of objects, even if only one object was requested. This list can contain 0 or more elements.

For example: returns not a single course, but a list with single course.


All responses to GET requests are paginated. They contain extra meta object with the information about pagination. It may look like this:

    meta: {
        page: 1,
        has_next: true,
        has_previous: false
    requested_objects: [...]

If the next page exists, then it can be requested using get parameter ?page=.... By default, if no parameter is given, it’s equal to 1.

For example: is equal to Next page: and so on.

Usual page size is equal to 20 elements, but it can vary due to API endpoint, user’s permissions etc. We do not recommend to rely on a constant page size.


Response may also contain multiple objects, related to the requested object.

For example: for registered user, response from also includes user’s course enrollments.

OAuth 2

In order to call API as a registered user, you can use this user’s OAuth2 keys. You can get your keys by creating an application on (while being logged in), and you can also set redirect_uri, Client type and Authorization grant type there.

Authorization endpoint (Authorization code, Implicit grant; redirect_uri needed):

Token endpoint (Authorization code, Password and Client credentials):

Client credentials flow

You can then obtain access token using the following client credential flow:

curl -X POST -d "grant_type=client_credentials" -u"CLIENT_ID:CLIENT_SECRET"


{"access_token": "ACCESS_TOKEN", "scope": "read write", "expires_in": 36000, "token_type": "Bearer"}

Example with access token:

curl -H "Authorization: Bearer ACCESS_TOKEN" ""


{"meta": {"page": 1, "has_next": false, "has_previous": false}, "social-accounts": []}

Authorization code flow

  • Set grant type = autorization_code and set redirect_uri in your application;
  • Redirect user to;
  • User should authenticate or register, and grant permissions to application;
  • It redirects to redirect_uri and receives the CODE;
  • Application asks for ACCESS_TOKEN: curl -X POST -d "grant_type=authorization_code&code=CODE&redirect_uri=REDIRECT_URI" -u"CLIENT_ID:SECRET_ID";
  • Application behaves as user, adding Authorization: Bearer ACCESS_TOKEN; to request headers.
  • Request to returns the current user.

Multiple IDs Calls

You can request multiple objects using the single API call by using ?ids[]=2&ids[]=3....

For example: to get courses with IDs = 2, 67, 76 and 70; you can to call[]=2&ids[]=67&ids[]=76&ids[]=70.

This syntax is supported by all API endpoints.

Don’t make calls with large size of ids[]. Such calls may be rejected by the server because of a large HTTP header.


Simple operations:

Complete examples:

You can’t perform that action at this time.