# Coursera API scraper — search courses, specializations, professional certificates and guided projects by keyword, then pull full program detail (description, rating, enrollment count, difficulty, languages, skills, instructors, partners, what-you'll-learn and the courses inside a specialization), plus top student reviews, browse every university & company partner and the subject catalogue. Returns title, partner, rating, review count, enrollments, level, duration, price/free status, skills and instructors for any Coursera course or program. No API key required.

> Search Coursera by keyword (any topic, skill, tool or title). Returns a paginated list of result cards — name, url, type (course / specialization / professional certificate / guided project), partner, rating, review count, difficulty, duration, skills and free status — most-relevant first. Optional filters: level, type, language, sort. Feed a result's slug/url into the detail action. Page with `page`; meta.has_more / meta.total_count tell you how many.
> ReefAPI engine `coursera` · 5 endpoints · clean JSON, no scraping or browsers to manage.

## How to call
- **Endpoint:** `POST https://api.reefapi.com/coursera/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 /coursera/v1/search — 1 credit
Search Coursera by keyword (any topic, skill, tool or title). Returns a paginated list of result cards — name, url, type (course / specialization / professional certificate / guided project), partner, rating, review count, difficulty, duration, skills and free status — most-relevant first. Optional filters: level, type, language, sort. Feed a result's slug/url into the detail action. Page with `page`; meta.has_more / meta.total_count tell you how many.

**Parameters:**
- `query` (string, required) — What to search Coursera for — a topic, skill, tool or course/program title ('machine learning', 'python', 'excel', 'project management', 'aws'). Returns courses, specializations, professional certificates and guided projects, most-relevant first.
- `level` (string, optional) — Filter by difficulty. One of: Beginner, Intermediate, Advanced, Mixed.
- `type` (string, optional) — Filter by product type. One of: Courses, Specializations, Professional Certificates, Guided Projects, Degrees.
- `language` (string, optional) — Filter by course language (e.g. English, Spanish, French, Arabic).
- `sort` (string, optional) — Result order: Relevance (default) or Newest.
- `page` (integer, optional, default 1) — Result page (12 per page). Page until meta.has_more is false; meta.total_count / meta.total_pages tell you how many.
- `subject` (string, optional) — Optional subject/topic slug to bias the search (e.g. data-science, business, computer-science).

**Returns:** results[]{id, name, url, slug, type, difficulty, duration, rating, review_count, partners[], skills[], is_free, is_coursera_plus, image, tagline} + meta{page, has_more, next_page, total_count, total_pages}

**Example request body:**
```json
{
  "query": "machine learning"
}
```

### POST /coursera/v1/detail — 1 credit
Full detail for one Coursera course OR program (specialization / professional certificate) by slug or URL. For a course: description, difficulty, estimated workload, rating (average, count, by-star), total enrollments, languages, certificates, what-you'll-learn, recommended background, skills, instructors and partners. For a program: the same plus the list of courses inside it. Pass a search result's url, or a slug with type='specialization' to force the program path.

**Parameters:**
- `slug` (string, optional) — The course/program slug (the last path segment of a Coursera URL, e.g. 'machine-learning' from /learn/machine-learning, or 'machine-learning-introduction' from /specializations/…). From a search result's slug.
- `url` (string, optional) — Alternatively a full Coursera course/specialization URL (a search result's `url`). The path selects course vs program automatically.
- `type` (string, optional) — Optional, only when passing a bare slug: 'course' (default) or 'specialization' / 'professional certificate' to force the program path.

**Returns:** course_or_program{id, type, name, slug, url, description, difficulty, estimated_workload, ratings{average, rating_count, comment_count}, ratings_by_star{...}, total_enrollments, primary_languages[], certificates[], what_you_will_learn[], recommended_background, skills[], instructors[]{id, name, title, courses_taught, learners_reached}, partners[]{id, name, logo}, courses[] (programs only)}

**Example request body:**
```json
{
  "slug": "machine-learning"
}
```

### POST /coursera/v1/reviews — 1 credit
Top public student reviews for a Coursera course or program by slug/url: star rating, review text, author and date. Returns the most-helpful reviews Coursera surfaces on the page (top reviews — Coursera does not expose deep review pagination without login). Use meta.review_count for the total number of ratings.

**Parameters:**
- `slug` (string, optional) — The course/program slug to pull top reviews for (from a search result's slug).
- `url` (string, optional) — Alternatively a full Coursera course/program URL.
- `type` (string, optional) — Optional, only with a bare slug: 'course' (default) or 'specialization'.

**Returns:** reviews[]{review_id, author, rating, comment, date} + meta{review_count, rating_average}

**Example request body:**
```json
{
  "slug": "machine-learning"
}
```

### POST /coursera/v1/partners — 0 credits
Browse the universities and companies that partner with Coursera (Stanford, University of Michigan, Google, IBM, …). Returns partner id, name and logo. Use it to map who publishes on Coursera.

**Parameters:** none

**Returns:** partners[]{id, name, logo}

### POST /coursera/v1/subjects — 0 credits
Browse Coursera's subject catalogue — the top-level domains (Data Science, Business, Computer Science, Arts & Humanities, …) with their slug and description. Use a subject slug as the search `subject` filter.

**Parameters:** none

**Returns:** subjects[]{name, slug, description}

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