# edX Course Scraper (`crawlerbros/edx-scraper`) Actor

Scrape edX - the world's leading MOOC platform. Search courses, browse by subject or university, fetch specific course URLs. Extracts title, institution, level, duration, effort, pricing, enrollment count, rating, skills, and more.

- **URL**: https://apify.com/crawlerbros/edx-scraper.md
- **Developed by:** [Crawler Bros](https://apify.com/crawlerbros) (community)
- **Categories:** Automation, Integrations, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## edX Course Scraper

Scrape online courses from [edX](https://www.edx.org/) — one of the world's leading MOOC platforms featuring courses from MIT, Harvard, Stanford, Berkeley, IBM, Microsoft, and 200+ top institutions worldwide. Acquired by 2U, edX hosts thousands of courses, professional certificates, MicroMasters programs, and degree programs across dozens of subjects.

### Features

- **Search mode** — find courses by keyword (e.g., "python programming", "machine learning", "data science")
- **Browse by subject** — get all courses for a specific topic (computer science, data analysis, AI, finance, etc.)
- **Browse by university** — get all courses from a specific institution (harvardx, mitx, berkeleyx, ibm, etc.)
- **Single course URL** — scrape one or more specific edX course pages for complete details
- Filters: level (Introductory / Intermediate / Advanced), course type (Course / Professional Certificate / MicroMasters / etc.), free-only, language
- Output includes: title, institution, subject, level, duration, effort, pricing, enrollment count, skills, availability, pacing, image URL, course URL, and more

### Input

| Field | Type | Description |
|-------|------|-------------|
| `mode` | select | `search` (default), `bySubject`, `byUniversity`, `byUrl` |
| `searchQuery` | string | Text search query (mode=search) |
| `subject` | select | Subject slug — e.g. `computer-science`, `data-analysis` (mode=bySubject) |
| `universitySlug` | string | University slug — e.g. `harvardx`, `mitx`, `ibm` (mode=byUniversity) |
| `courseUrls` | array | List of edX course URLs to scrape (mode=byUrl) |
| `filterLevel` | select | Filter by level: Introductory / Intermediate / Advanced |
| `filterCourseType` | select | Filter by type: Course / Professional Certificate / MicroMasters / etc. |
| `filterIsFree` | boolean | Only return free courses |
| `filterLanguage` | string | ISO 639-1 language code (e.g. `en`, `es`, `fr`) |
| `maxItems` | integer | Max number of records to return (1–1000, default 50) |

#### Example Inputs

**Search for Python courses:**

```json
{
  "mode": "search",
  "searchQuery": "python programming",
  "maxItems": 20
}
```

**Browse CS courses from Harvard:**

```json
{
  "mode": "byUniversity",
  "universitySlug": "harvardx",
  "filterCourseType": "Course",
  "maxItems": 50
}
```

**Browse AI/ML courses:**

```json
{
  "mode": "bySubject",
  "subject": "artificial-intelligence",
  "filterLevel": "Intermediate",
  "maxItems": 30
}
```

### Output

Each record contains:

| Field | Type | Description |
|-------|------|-------------|
| `courseId` | string | edX product UUID |
| `title` | string | Course title |
| `description` | string | Full course description (HTML stripped) |
| `institution` | string | Primary university/institution name |
| `institutions` | array | All institution names (for multi-partner courses) |
| `subject` | string | Primary subject |
| `subjects` | array | All subject categories |
| `level` | string | Introductory / Intermediate / Advanced |
| `durationWeeks` | integer | Total duration in weeks |
| `durationWeeksMin` | integer | Minimum weeks to complete |
| `durationWeeksMax` | integer | Maximum weeks to complete |
| `effortHoursPerWeekMin` | number | Min hours per week effort |
| `effortHoursPerWeekMax` | number | Max hours per week effort |
| `pacing` | string | self\_paced or instructor\_paced |
| `language` | string | Primary language |
| `availability` | string | Current / Archived / etc. |
| `isFree` | boolean | Whether the course is free to audit |
| `price` | number | Full price in USD |
| `originalPrice` | number | Original price before discount |
| `currency` | string | Currency code (e.g. USD) |
| `enrollmentCount` | integer | Recent enrollment count |
| `skills` | array | Skills covered in the course |
| `courseType` | string | Course / Professional Certificate / MicroMasters / etc. |
| `imageUrl` | string | Course thumbnail URL |
| `courseUrl` | string | Full edX course URL |
| `startDate` | string | Go-live date (ISO format) |
| `productSource` | string | edX |
| `sourceUrl` | string | URL that was scraped |
| `scrapedAt` | string | UTC timestamp of scrape |
| `recordType` | string | Always "course" |

#### Sample Output

```json
{
  "courseId": "b3c02aea-cbf6-4fc4-a730-0433860e2a35",
  "title": "Python for Data Science",
  "description": "Learn to use powerful, open-source, Python tools including Pandas, Git and Matplotlib...",
  "institution": "The University of California, San Diego",
  "subject": "Computer Science",
  "subjects": ["Computer Science", "Data Analysis & Statistics"],
  "level": "Intermediate",
  "durationWeeks": 10,
  "effortHoursPerWeekMin": 3,
  "effortHoursPerWeekMax": 5,
  "pacing": "self_paced",
  "language": "English",
  "availability": "Current",
  "isFree": false,
  "price": 149.0,
  "currency": "USD",
  "enrollmentCount": 333911,
  "skills": ["Python (Programming Language)", "Data Science", "Pandas"],
  "courseType": "Course",
  "imageUrl": "https://prod-discovery.edx-cdn.org/media/course/image/b3c02aea.jpg",
  "courseUrl": "https://www.edx.org/learn/python/the-university-of-california-san-diego-python-for-data-science",
  "sourceUrl": "https://www.edx.org/learn/python",
  "scrapedAt": "2026-06-06T12:00:00+00:00",
  "recordType": "course"
}
```

### FAQ

**What subjects are supported?**
All edX subjects are supported including Computer Science, Data Analysis, AI, Business & Management, Engineering, Healthcare, Math, Physics, Social Sciences, Language, and more.

**Can I get courses by a specific university?**
Yes — use `mode=byUniversity` with a slug like `harvardx`, `mitx`, `berkeleyx`, `microsoft`, `ibm`, `googlecloud`, etc.

**Are free courses available?**
Many edX courses are free to audit. Use `filterIsFree: true` to return only free courses.

**Does this include boot camps and degree programs?**
Yes — edX hosts Boot Camps, MicroBachelors, MicroMasters, Professional Certificates, and full Degrees. Use `filterCourseType` to narrow down.

**What is the daily test prefill?**

```json
{"mode": "search", "searchQuery": "python programming", "maxItems": 5}
```

### Data Source

edX embeds course data in its Next.js server-rendered HTML pages (RSC JSON payloads). This actor parses that embedded data without requiring authentication or API keys. Data is publicly accessible and does not require a proxy.

# Actor input Schema

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

What to scrape.

## `searchQuery` (type: `string`):

Free-text search query (mode=search). E.g. 'python programming', 'machine learning', 'data science'.

## `subject` (type: `string`):

edX subject slug to browse. Used when mode=bySubject.

## `universitySlug` (type: `string`):

edX university/institution slug, e.g. 'harvardx', 'mitx', 'berkeleyx', 'microsoft', 'ibm'. Used when mode=byUniversity.

## `courseUrls` (type: `array`):

List of edX course URLs to scrape. E.g. https://www.edx.org/learn/python/the-university-of-california-san-diego-python-for-data-science

## `filterLevel` (type: `string`):

Only include courses of this difficulty level.

## `filterCourseType` (type: `string`):

Only include courses of this type.

## `filterIsFree` (type: `boolean`):

If true, only return courses that are free to audit.

## `filterLanguage` (type: `string`):

2-letter ISO 639-1 language code. E.g. 'en', 'es', 'fr', 'de', 'zh'. Leave empty for all languages.

## `maxItems` (type: `integer`):

Maximum number of course records to output.

## Actor input object example

```json
{
  "mode": "search",
  "searchQuery": "python programming",
  "subject": "computer-science",
  "courseUrls": [],
  "filterLevel": "",
  "filterCourseType": "",
  "filterIsFree": false,
  "maxItems": 50
}
```

# Actor output Schema

## `courses` (type: `string`):

Dataset containing all scraped edX course records.

# 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 = {
    "mode": "search",
    "searchQuery": "python programming",
    "courseUrls": [],
    "filterLevel": "",
    "filterCourseType": "",
    "filterIsFree": false,
    "maxItems": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("crawlerbros/edx-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 = {
    "mode": "search",
    "searchQuery": "python programming",
    "courseUrls": [],
    "filterLevel": "",
    "filterCourseType": "",
    "filterIsFree": False,
    "maxItems": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("crawlerbros/edx-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 '{
  "mode": "search",
  "searchQuery": "python programming",
  "courseUrls": [],
  "filterLevel": "",
  "filterCourseType": "",
  "filterIsFree": false,
  "maxItems": 50
}' |
apify call crawlerbros/edx-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,crawlerbros/edx-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/vjFKVfb5RXJIS2Jrh/builds/j5DIrYi9ZwoQxXx2u/openapi.json
