# 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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).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": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=crawlerbros/edx-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "edX Course Scraper",
        "description": "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.",
        "version": "1.0",
        "x-build-id": "j5DIrYi9ZwoQxXx2u"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/crawlerbros~edx-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-crawlerbros-edx-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/crawlerbros~edx-scraper/runs": {
            "post": {
                "operationId": "runs-sync-crawlerbros-edx-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/crawlerbros~edx-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-crawlerbros-edx-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "mode"
                ],
                "properties": {
                    "mode": {
                        "title": "Mode",
                        "enum": [
                            "search",
                            "bySubject",
                            "byUniversity",
                            "byUrl"
                        ],
                        "type": "string",
                        "description": "What to scrape.",
                        "default": "search"
                    },
                    "searchQuery": {
                        "title": "Search query",
                        "type": "string",
                        "description": "Free-text search query (mode=search). E.g. 'python programming', 'machine learning', 'data science'.",
                        "default": "python programming"
                    },
                    "subject": {
                        "title": "Subject / topic (mode=bySubject)",
                        "enum": [
                            "artificial-intelligence",
                            "business-management",
                            "chemistry",
                            "communication",
                            "computer-science",
                            "data-analysis",
                            "design",
                            "economics-finance",
                            "education-teacher-training",
                            "electronics",
                            "energy-earth-sciences",
                            "engineering",
                            "environmental-studies",
                            "ethics",
                            "food-nutrition",
                            "health-safety",
                            "history",
                            "humanities",
                            "language",
                            "law",
                            "literature",
                            "math",
                            "medicine",
                            "music",
                            "philosophy-ethics",
                            "physics",
                            "science",
                            "social-sciences",
                            "statistics-data-science"
                        ],
                        "type": "string",
                        "description": "edX subject slug to browse. Used when mode=bySubject.",
                        "default": "computer-science"
                    },
                    "universitySlug": {
                        "title": "University slug (mode=byUniversity)",
                        "type": "string",
                        "description": "edX university/institution slug, e.g. 'harvardx', 'mitx', 'berkeleyx', 'microsoft', 'ibm'. Used when mode=byUniversity."
                    },
                    "courseUrls": {
                        "title": "Course URLs (mode=byUrl)",
                        "type": "array",
                        "description": "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",
                        "default": [],
                        "items": {
                            "type": "string"
                        }
                    },
                    "filterLevel": {
                        "title": "Filter by level",
                        "enum": [
                            "",
                            "Introductory",
                            "Intermediate",
                            "Advanced"
                        ],
                        "type": "string",
                        "description": "Only include courses of this difficulty level.",
                        "default": ""
                    },
                    "filterCourseType": {
                        "title": "Filter by course type",
                        "enum": [
                            "",
                            "Course",
                            "Professional Certificate",
                            "MicroMasters",
                            "MicroBachelors",
                            "Executive Education",
                            "Boot Camp",
                            "Degree"
                        ],
                        "type": "string",
                        "description": "Only include courses of this type.",
                        "default": ""
                    },
                    "filterIsFree": {
                        "title": "Free courses only",
                        "type": "boolean",
                        "description": "If true, only return courses that are free to audit.",
                        "default": false
                    },
                    "filterLanguage": {
                        "title": "Filter by language (ISO 639-1)",
                        "type": "string",
                        "description": "2-letter ISO 639-1 language code. E.g. 'en', 'es', 'fr', 'de', 'zh'. Leave empty for all languages."
                    },
                    "maxItems": {
                        "title": "Max items",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum number of course records to output.",
                        "default": 50
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
