# Coursera Courses Scraper (Ratings & Syllabus) (`scrapyx/coursera-courses-scraper`) Actor

Coursera courses from the site's own sitemap: title, partners, displayed rating and count, difficulty, skills, instructors, the full week-by-week syllabus with durations, and the parent specialization. Courses the sitemap lists but no longer serves are counted, not dropped.

- **URL**: https://apify.com/scrapyx/coursera-courses-scraper.md
- **Developed by:** [Ibnu Adzim](https://apify.com/scrapyx) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.84 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Coursera Courses Scraper (Ratings & Syllabus)

Coursera courses from the site's **own published sitemap** and course pages:
title, partner universities and companies, the rating the site displays with
its count, difficulty and duration band, skills, instructors with their
learner reach, the full week-by-week syllabus with per-item durations, the
parent specialization, translated languages and a review sample.

HTTP only, no login, no key, no browser. One request for the whole catalogue
(21,000+ course URLs), then one request per course page.

### What it is for

- **Catalogue snapshots** by keyword — every `python` or `finance` course with
  rating, enrolment-facing numbers and syllabus.
- **Course monitoring** — a list of slugs on a schedule, diff the ratings.
- **Curriculum research** — weeks, lessons and minutes per course.

### Input

| field | what it does |
| --- | --- |
| `mode` | `catalog` (default): read the sitemap, filter by `keyword`, fetch course pages. `courses`: fetch the slugs/URLs you give. |
| `keyword` | Catalog mode. Matched against the course slug (`machine-learning`, `python`, `finance`). Empty = the catalogue in sitemap order. |
| `courses` | Courses mode. Slugs, `/learn/...` paths or full URLs. |
| `fetchDetails` | On by default. The sitemap carries URLs only; everything else is on the course page. |
| `maxResults`, `maxConcurrency`, `minRequestInterval`, `proxyConfiguration` | Limits. Pages are ~950 KB each; keep runs modest. |

### Three things about this site worth knowing before you trust a run

#### 1. Discovery uses the sitemap, not the search — by policy

Coursera's `robots.txt` disallows `/search` and `/api/`. This Actor never
touches them. It reads the sitemap Coursera itself links from `robots.txt`,
which lists the entire catalogue under the allowed `/learn/` prefix, and
filters that list by keyword. (`robots.txt` also names ClaudeBot with a
single rule, `Disallow: /lecture/`; nothing here requests `/lecture/`.)

#### 2. Most of the sitemap no longer serves a course

Measured 2026-09-16 on random slugs from the live sitemap: **9 of 14** answered
HTTP 200 with intact markup and **no course record** — withdrawn, region-gated
or renamed courses Coursera still lists. That is a real state of the
catalogue, not a parser fault, so it has its own outcome
(`course_unavailable`) and every summary carries `coursesUnavailable`,
`coursesUnavailableShare` and `sitemapListsMoreThanIsServed`. A run that
selects 8 slugs and returns 2 courses is telling you about Coursera, and says
so.

#### 3. The course JSON-LD is gone; the data is in the Apollo cache, and it lies twice

Course pages carry no `Course` JSON-LD any more (0 of 20 checked). The data
lives in `window.__APOLLO_STATE__`, richer than the JSON-LD ever was — but:

- a course page carries **three** course nodes (the course and its siblings in
  the specialization); the Actor takes the one whose slug matches the URL
  requested, never the first;
- the rating on the course node is the **instructor** rating (4.95); the
  rating the site displays (`ratingValue`, 4.89 with `ratingCount` 32,911)
  lives on a different node. Both are emitted, named for what they are.

Difficulty and duration are enum strings (`BEGINNER`, `ONE_TO_FOUR_WEEKS`) —
there is no numeric week count on the site; `weekCount` and `lessonCount` are
counted from the syllabus itself. Per-item durations are ISO-8601 and are
converted to minutes with the original kept.

### Output

- **`COURSE`** — `slug`, `courseId`, `name`, `courseUrl`, `description`,
  `ratingValue`, `ratingCount`, `instructorRating`,
  `contentSatisfactionRatingsCount`, `difficultyLevel`, `durationBand`,
  `partnerNames`, `partnerWebsites`, `instructorNames`, `instructors` (with
  learner reach), `skills`, `specializationName`, `specializationSlug`,
  `weekCount`, `lessonCount`, `totalLessonMinutes`, `weeks` (items with
  durations), `translatedLanguages`, `reviewSampleCount`,
  `reviewSampleAverage`, `catalogRank`, `discovery`.
- **`SEARCH_SUMMARY`** — one per run: `keyword`, `catalogueSize`,
  `matchedCourses`, `coursesReturned`, `detailsFetched`, `coursesUnavailable`,
  `coursesUnavailableShare`, `stoppedBeforeExhausted`, `requestsMade`,
  `sitemapListsMoreThanIsServed`.
- **`ERROR`** — `course_unavailable` (per slug), `not_found` (a clean 404),
  `unexpected_shape`, `fetch_failed`, with detail.

### Known limits

- Keyword matching is on the **slug**, because that is what the sitemap
  carries; a course whose slug does not contain the word is not found by it.
  Use `courses` mode for exact lists.
- Enrolment counts, prices and reviews beyond the page's sample are not on
  the course page and are not fetched.
- The catalogue is a ceiling: expect roughly a third to two thirds of any
  slice to be `course_unavailable` until Coursera prunes its sitemap.

# Actor input Schema

## `mode` (type: `string`):

`catalog` reads Coursera's own sitemap — the whole 21,000-course catalogue in one request — and filters it by keyword. `courses` takes slugs or URLs you already have.

## `keyword` (type: `string`):

Catalog mode. Matched against the course slug, e.g. `python`, `machine-learning`, `finance`. Leave empty to take the catalogue in order.

## `courses` (type: `array`):

Courses mode. A slug (`machine-learning`), a path (`/learn/machine-learning`) or a full URL.

## `fetchDetails` (type: `boolean`):

On by default. The sitemap carries only URLs — titles, ratings, enrolment, skills and syllabus all come from the course page.

## `maxResults` (type: `integer`):

Catalog mode cap. Course pages are large, so a big run is a slow one.

## `maxConcurrency` (type: `integer`):

Parallel in-flight requests.

## `minRequestInterval` (type: `number`):

Politeness pacing between request starts.

## `proxyConfiguration` (type: `object`):

Optional. No anti-bot layer was observed, so a proxy is OFF by default.

## Actor input object example

```json
{
  "mode": "catalog",
  "keyword": "python",
  "courses": [
    "machine-learning"
  ],
  "fetchDetails": true,
  "maxResults": 50,
  "maxConcurrency": 4,
  "minRequestInterval": 0.4,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `items` (type: `string`):

One row per scraped record. See the dataset's default view for field definitions.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "keyword": "python",
    "courses": [
        "machine-learning"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrapyx/coursera-courses-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "keyword": "python",
    "courses": ["machine-learning"],
}

# Run the Actor and wait for it to finish
run = client.actor("scrapyx/coursera-courses-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "keyword": "python",
  "courses": [
    "machine-learning"
  ]
}' |
apify call scrapyx/coursera-courses-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,scrapyx/coursera-courses-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/0VuMjebpbT1RivMyB/builds/nodiBsEqJfxcpFdtP/openapi.json
