Search API Connector Documentation

Print

Import Udemy Data to Google Sheets

In this guide, we’ll walk through how to pull course data from the Udemy API directly into Google Sheets, using the API Connector add-on for Sheets.

We'll first get some credentials from Udemy, and then set up a request to pull in data to your spreadsheet.

Nov 2022 Update: The Udemy API is currently not working, and the instructions below will not return any data. I'll remove this note once they fix it.

Contents

Before You Begin

Click here to install the API Connector add-on from the Google Marketplace.

Part 1: Get Your Udemy API Credentials

  1. Log in to your Udemy account and click your account icon in the top right, then API Clients from the left sidebar (or click https://www.udemy.com/user/edit-api-clients/ to go there directly).
    udemy-img1
  2. Click Request Affiliate API Client
    udemy-img2
  3. You'll be asked to provide some information about how you'll use their API data. Fill it out with the relevant details and click Save.
    udemy-img3
  4. You will need to wait a day or so to be approved. Once you receive your approval email, click back into the API Client section, and you should now see your authentication details. Pay attention to the client ID and secret as we'll need those next.
    udemy-img4

Part 2: Create Your API Request

Udemy requires that we encode our client ID and secret using Basic Auth. To speed things up a little, let's import a cURL snippet. This will set up the whole request in one go, and take care of encoding your credentials for you.

  1. Copy the following snippet to your clipboard
    curl --user YOUR_CLIENT_ID:YOUR_CLIENT_SECRET https://www.udemy.com/api-2.0/courses/?page_size=100&category=Music&ordering=most-reviewed
  2. Click Extensions > API Connector > Import / Export > Import cURL and paste in that snippet. It should look like this. Don't hit import just yet.
    udemy-img5
  3. Now substitute in your client ID and client secret (leave the colon separator between them). Click Import and you'll see the request appear in the API Connector sidebar.
    udemy-img7
  4. One last step: the API response from Udemy is pretty nested, which can cause issues with rows not lining up. As a simple solution, I suggest choosing the "concatenate" report style.
    udemy-img6
  5. Click Run and you'll see a list of 100 Music courses from Udemy, sorted by review count.
    udemy-img8
  6. Of course you can go back and edit this request to get the categories or search terms you're interested in. This page contains a handy request builder you can use to check out different parameters: https://www.udemy.com/developers/affiliate/methods/get-courses-list/

Part 3: Handle Pagination

By default, Udemy only returns a maximum of 100 records. To get more you need to navigate through their next page URLs.

In API Connector you can set up automatic pagination handling as follows:

  • URL: set up your URL as usual, including the page_size=100 parameter
  • Pagination type: next page URL
  • Next page path: next
  • Run until: choose when to stop fetching data
    udemy-pagination-nextpageurl

Part 4: API Documentation

Official API documentation: https://www.udemy.com/developers/affiliate/

2 thoughts on “Import Udemy Data to Google Sheets”

  1. Have you tried this lately? I stopped getting results and found if I added a "[email protected]" I could get results again. However, I keep getting the same results from page one over and over again. My search should bet 1200 results and no matter what search parameters I add, I get 360 unless my limited bring my results below 360 results. I can't find a forum or a help desk to report my issue.

    Reply
    • Hey Tracy, you're right, their API seems totally broken. I tested it in their own request builder and got the same results as you (zero results without adding [email protected], and pagination links not working). I sent their support a message explaining the issue, hopefully they'll take a look and address it.
      Update: they responded saying "Our team has been alerted and is currently working on a solution."

      Reply

Leave a Comment

Jump To...