# edX API scraper — search the edX online-course catalogue by keyword and pull full course/program detail. Search 6,000+ university and industry courses, professional certificates, MicroMasters, XSeries and online degrees from Harvard, MIT, IBM, Google, Stanford and 250+ partners — filter by level, subject, language, partner and product type. Returns title, partner/university, level, languages, duration, effort, price/free-audit status, skills, enrollment count and the full description, what-you'll-learn, prerequisites, syllabus, instructors and the courses inside a program. Browse every partner school and subject. No API key required.

> Search the edX catalogue by keyword (any topic, skill, tool or course/program title — 'python', 'machine learning', 'data science', 'cybersecurity', 'finance'). Returns a paginated list of result cards: name, url, type (course / program / executive education / degree), partner, level, languages, subjects, duration, effort, price, skills and enrollment. Optional filters: level, type, program_type, language, subject, partner, availability. Page with `page` (20 per page); meta.has_more / meta.total_count tell you how many. Feed a result's slug/url into the detail action.
> ReefAPI engine `edx` · 4 endpoints · clean JSON, no scraping or browsers to manage.

## How to call
- **Endpoint:** `POST https://api.reefapi.com/edx/v1/<action>` with a JSON body.
- **Auth:** header `x-api-key: <YOUR_REEFAPI_KEY>` — create one free (1,000 credits, no card): https://reefapi.com/signup
- **Response (every call):** `{ ok: boolean, data: ..., meta: { record_count, credits, ... }, error: { code, message } }` — branch on `ok`. Failed or blocked calls are free.
- **One key + one shared credit pool** across every ReefAPI API. Per-call credits are listed on each endpoint below.
- **Use it from an AI agent (MCP):** connect `https://api.reefapi.com/mcp` (remote streamable-http, `Authorization: Bearer <key>`) and your assistant can call these actions directly.

## Endpoints

### POST /edx/v1/search — 1 credit
Search the edX catalogue by keyword (any topic, skill, tool or course/program title — 'python', 'machine learning', 'data science', 'cybersecurity', 'finance'). Returns a paginated list of result cards: name, url, type (course / program / executive education / degree), partner, level, languages, subjects, duration, effort, price, skills and enrollment. Optional filters: level, type, program_type, language, subject, partner, availability. Page with `page` (20 per page); meta.has_more / meta.total_count tell you how many. Feed a result's slug/url into the detail action.

**Parameters:**
- `query` (string, required) — What to search edX for — a topic, skill, tool or course/program title ('python', 'machine learning', 'excel', 'cybersecurity', 'project management').
- `level` (string, optional) — Filter by difficulty: Introductory, Intermediate or Advanced. [one of: Introductory, Intermediate, Advanced]
- `type` (string, optional) — Filter by product type: Course, Program, Executive Education or 2U Degree. [one of: Course, Program, Executive Education, 2U Degree]
- `program_type` (string, optional) — For programs, filter by program type: Professional Certificate, MicroMasters, XSeries, MicroBachelors, Bachelors, Masters, Doctorate, Certificate. [one of: Professional Certificate, MicroMasters, XSeries, MicroBachelors, Bachelors, Masters, Doctorate, Certificate]
- `language` (string, optional) — Filter by course language (English, Spanish, French, Italian, Arabic, Portuguese, German, …). Use the subjects/partners-style facet names exactly.
- `subject` (string, optional) — Filter by subject area (Computer Science, Business & Management, Data Analysis & Statistics, Engineering, Economics & Finance, …). See the subjects action.
- `partner` (string, optional) — Filter by partner school/company exactly as named (Harvard University, MIT, IBM, Google Cloud, …). See the partners action.
- `availability` (string, optional) — Filter by availability: Available now, Upcoming or Archived. [one of: Available now, Upcoming, Archived]
- `page` (integer, optional, default 1) — Result page (20 per page). Page until meta.has_more is false; meta.total_count / meta.total_pages tell you how many.

**Returns:** results[]{id, object_id, name, url, slug, type, program_type, partner, partners[], level, languages[], subjects[], availability, weeks_to_complete, min_effort, max_effort, subscription_eligible, recent_enrollment_count, skills[], image, short_description} + meta{page, has_more, next_page, total_count, total_pages}. (Price is on the detail action — edX's catalogue index does not carry per-result prices; audit/free-track status is per course run.)

**Example request body:**
```json
{
  "query": "python"
}
```

### POST /edx/v1/detail — 1 credit
Full detail for one edX course OR program by slug or URL. For a course: level, languages, duration, effort, price, enrollment count, full description, what-you'll-learn, overview, prerequisites, syllabus, skills, subjects, partners, instructors (faculty) and course runs (sessions). For a program (professional certificate / MicroMasters / XSeries / degree): the same plus the list of courses inside it. Pass a search result's url or slug.

**Parameters:**
- `slug` (string, optional) — The course/program slug — the path of an edX URL after the domain (a search result's `slug`, e.g. 'learn/python/harvard-university-cs50-s-introduction-to-programming-with-python').
- `url` (string, optional) — Alternatively a full edX course/program URL (a search result's `url`).

**Returns:** course_or_program{id, name, type, slug, url, level, availability, price{price, currency, free_audit_available, offer_categories[]}, enrollment_count, recent_enrollment_count, weeks_to_complete, description, what_you_will_learn[], overview[], prerequisites[], syllabus, skills[], subjects[], partners[]{name, key, slug, logo}, staff[], course_runs[], courses[] (programs only), programs[], image, video}

**Example request body:**
```json
{
  "slug": "learn/python/harvard-university-cs50-s-introduction-to-programming-with-python"
}
```

### POST /edx/v1/partners — 0 credits
Browse every school, university and company that publishes on edX (Harvard, MIT, IBM, Google Cloud, Stanford, Delft, …) with the number of courses/programs each offers. Use a partner name as the search `partner` filter.

**Parameters:** none

**Returns:** partners[]{name, course_count}

### POST /edx/v1/subjects — 0 credits
Browse edX's subject areas (Computer Science, Business & Management, Data Analysis & Statistics, Engineering, Economics & Finance, …) with the number of courses in each. Use a subject name as the search `subject` filter.

**Parameters:** none

**Returns:** subjects[]{name, course_count}

## More
- Try it live, no code: https://reefapi.com/playground?engine=edx
- Human docs page: https://reefapi.com/docs/edx
- Every ReefAPI API in one file (for your AI): https://reefapi.com/llms-full.txt
