Udemy API Documentation (v2.0)

The Udemy API exposes a lot of functionalities of Udemy to help developers build client applications and integrations with Udemy.

It is organized around REST. Our API is designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which can be understood by off-the-shelf HTTP clients. We only accept https calls to the API. All responses will be returned in JSON format, including errors. OAuth 2 protocol is used for user authorization (not documented yet).

Udemy API is currently at version 2.0 and the root endpoint is https://www.udemy.com/api-2.0/ for all resources.

Creating an API Client

To make any calls to Udemy REST API, you will need to create an API client. API client consists of a bearer token, which is connected to a user account on Udemy.

If you want to create an API client, Sign up on udemy.com and go to API Clients page in your user profile. Once your API client request is approved, your newly created API client will be active and your bearer token will be visible on API Clients page.

Sending an Authenticated Request

Udemy API requires basic authentication parameters to validate the client. The auth parameters have to be sent in every call or you will get a 401 UNAUTHORIZED error.

To send authenticated requests, provide the client_id and client_secret values as a base64 encoded HTTP Authorization header.

curl --user {YOUR_CLIENT_ID}:{YOUR_CLIENT_SECRET} https://www.udemy.com/api-2.0/courses
curl -H "Authorization: Basic {BASE64_ENCODED_CLIENT_ID:CLIENT_SECRET}" https://www.udemy.com/api-2.0/courses
Udemy API supports an optional request parameter fields to customize which fields should be returned for a particular object type. Fields parameter is a hash map which is usually defined as get parameters like fields[course], fields[user] etc... Each object type also has field lists @min, @default, and @all.

Examples

Return the course object with title and headline fields

https://www.udemy.com/api-2.0/courses/5816?fields[course]=title,headline

Return the course object with all fields in @min, plus the owner, but exclude the images. For the user object only return the title field

https://www.udemy.com/api-2.0/courses/5816?fields[course]=@min,owner,-images&fields[user]=title

Most of our apis return paginated responses. You can change the page size by specifying the page_size query parameter. The default page size is 12. The maximum page size is 100. You can change the page by specifying the page query parameter.

Udemy API uses conventional HTTP response codes to indicate success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that resulted from the provided information (e.g. a required parameter was missing, a charge failed, etc.), and codes in the 5xx range indicate an error with our servers.