{"id":21911712,"url":"https://github.com/stepicorg/stepik-api","last_synced_at":"2025-08-16T11:08:14.334Z","repository":{"id":142905929,"uuid":"58641126","full_name":"StepicOrg/Stepik-API","owner":"StepicOrg","description":"API documentation and Examples","archived":false,"fork":false,"pushed_at":"2023-05-22T21:44:57.000Z","size":4036,"stargazers_count":53,"open_issues_count":5,"forks_count":36,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-16T06:03:55.623Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StepicOrg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-05-12T12:51:21.000Z","updated_at":"2025-03-17T09:09:10.000Z","dependencies_parsed_at":"2025-04-16T04:51:05.742Z","dependency_job_id":null,"html_url":"https://github.com/StepicOrg/Stepik-API","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/StepicOrg/Stepik-API","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StepicOrg%2FStepik-API","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StepicOrg%2FStepik-API/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StepicOrg%2FStepik-API/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StepicOrg%2FStepik-API/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StepicOrg","download_url":"https://codeload.github.com/StepicOrg/Stepik-API/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StepicOrg%2FStepik-API/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270702562,"owners_count":24630877,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T18:07:23.658Z","updated_at":"2025-08-16T11:08:14.326Z","avatar_url":"https://github.com/StepicOrg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stepik.org API Readme\n\nStepik.org has REST API in JSON format. API endpoints are listed on https://stepik.org/api/docs, and you can also make API call there (but this page is limited to `GET` requests).\n\nStepik.org 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.\n\nAll API examples are up to date and working if the build status is `passing`: [![Build Status](https://travis-ci.org/StepicOrg/Stepik-API.svg?branch=master)](https://travis-ci.org/StepicOrg/Stepik-API)\n\n## Flat\n\nStepik API schema is flat, i.e. there are no nested end-points.\n\nEvery request returns a list of objects, even if only one object was requested. This list can contain 0 or more elements.\n\nFor example: `https://stepik.org/api/courses/1` returns not a single course, but a list with single course.\n\n## Pagination\n\nAll responses to `GET` requests are paginated. They contain extra `meta` object with the information about pagination. It may look like this:\n```\n{\n    meta: {\n        page: 1,\n        has_next: true,\n        has_previous: false\n    },\n    requested_objects: [...]\n}\n```\n\nIf 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.\n\nFor example: `https://stepik.org/api/courses` is equal to `https://stepik.org/api/courses?page=1`. Next page: `https://stepik.org/api/courses?page=2` and so on.\n\nUsual page size is equal to 20 elements, but it can vary due to API endpoint, user’s permissions etc. We \u003cb\u003edo not recommend to rely on a constant page size\u003c/b\u003e.\n\n## Side-Loading\n\nResponse may also contain multiple objects, related to the requested object.\n\nFor example: for registered user, response from `https://stepik.org/api/courses` also includes user’s course `enrollments`.\n\n## OAuth 2\n\nIn order to call Stepik.org API as a registered user, you can use this user’s OAuth2 keys.\nYou can get your keys by creating an application on https://stepik.org/oauth2/applications/ (while being logged in), and you can also set `redirect_uri`, `Client type` and `Authorization grant type` there.\n\nAuthorization endpoint (Authorization code, Implicit grant; redirect_uri needed): `https://stepik.org/oauth2/authorize/.`\n\nToken endpoint (Authorization code, Password and Client credentials): `https://stepik.org/oauth2/token/`.\n\n#### Client credentials flow\n\nYou can then obtain access token using the following client credential flow:\n\n`curl -X POST -d \"grant_type=client_credentials\" -u\"CLIENT_ID:CLIENT_SECRET\" https://stepik.org/oauth2/token/`\n\nResponse:\n\n`{\"access_token\": \"ACCESS_TOKEN\", \"scope\": \"read write\", \"expires_in\": 36000, \"token_type\": \"Bearer\"}`\n\nExample with access token:\n\n`curl -H \"Authorization: Bearer ACCESS_TOKEN\" \"https://stepik.org/api/social-accounts?provider=github\u0026uid=1216\"`\n\nResponse:\n\n`{\"meta\": {\"page\": 1, \"has_next\": false, \"has_previous\": false}, \"social-accounts\": []}`\n\n#### Authorization code flow\n\n- Set `grant type = autorization_code` and set `redirect_uri` in your application;\n- Redirect user to `https://stepik.org/oauth2/authorize/?response_type=code\u0026client_id=CLIENT_ID\u0026redirect_uri=REDIRECT_URI`;\n- User should authenticate or register, and grant permissions to application;\n- It redirects to `redirect_uri` and receives the `CODE`;\n- Application asks for `ACCESS_TOKEN`: `curl -X POST -d \"grant_type=authorization_code\u0026code=CODE\u0026redirect_uri=REDIRECT_URI\" -u\"CLIENT_ID:SECRET_ID\" https://stepik.org/oauth2/token/`;\n- Application behaves as user, adding `Authorization: Bearer ACCESS_TOKEN;` to request headers.\n- Request to `https://stepik.org/api/stepics/1` returns the current user.\n\n## Multiple IDs Calls\n\nYou can request multiple objects using the single API call by using `?ids[]=2\u0026ids[]=3...`.\n\nFor example: to get courses with IDs = `2`, `67`, `76` and `70`; you can to call `https://stepik.org/api/courses?ids[]=2\u0026ids[]=67\u0026ids[]=76\u0026ids[]=70`.\n\nThis syntax is supported by all API endpoints.\n\nDon’t make calls with large size of `ids[]`. Such calls may be rejected by the server because of a large HTTP header.\n\n## Examples\n\n#### Simple operations:\n\n- OAuth authorization example: [oauth_auth_example.py](/examples/oauth_auth_example.py)\n\n#### Complete examples:\n\n* VideoDownloader: [stepik-oauth2-videodownloader](https://github.com/StepicOrg/stepic-oauth2-videodownloader)\n* iOS app: [Stepik iOS app](https://github.com/StepicOrg/stepic-ios)\n* Android app: [Stepik Android app](https://github.com/StepicOrg/stepic-android)\n* Code Challenge submitter: [submitter.py](https://github.com/StepicOrg/SubmissionUtility/blob/master/submitter.py)\n* Video uploading (C#): [CoursePublishing](https://github.com/okulovsky/CoursePublishing/tree/master/Publishing/Stepic)\n* PyCharm Edu \u0026 IntelliJ integration: [intellij-community](https://github.com/JetBrains/intellij-community/tree/7e16c042a19767d5f548c84f88cc5edd5f9d1721/python/educational-core/student/src/com/jetbrains/edu/learning/stepic)\n* IntelliJ Plugin for Code Challenges: [intellij-plugins](https://github.com/StepicOrg/intellij-plugins)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstepicorg%2Fstepik-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstepicorg%2Fstepik-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstepicorg%2Fstepik-api/lists"}