# MIT OpenCourseWare API

> MIT OpenCourseWare returns course listings and materials as a workflow and API.

MIT OpenCourseWare finds courses by required topic or search words and orders matches by relevance. Search courses can filter by level or lecture videos and returns course details and available materials.

- Page: https://fous.com/workflows/mit-opencourseware
- Handle: `@mit-opencourseware`
- Category: [Education](https://fous.com/workflows/category/education)
- Source website: https://ocw.mit.edu
- Last verified: Sep 29, 2026
- Fous is not affiliated with MIT OpenCourseWare.

## Methods

### Search courses

Operation `search_courses`, version 1. 1 credit per call.

Find free MIT OpenCourseWare courses on a topic, in relevance order. Optionally limit to a course level or courses with lecture videos.

**Input**

| Field | Type | Required | Example | Description |
|---|---|---|---|---|
| `level` | string | no | `"undergraduate"` | Course level, for example undergraduate. |
| `topic` | string | yes | `"linear algebra"` | Topic or search words, for example linear algebra. |
| `max_results` | integer | no | `5` | Maximum courses to return, for example 20. |
| `with_video_lectures` | boolean | no | `true` | Only include courses with lecture videos, for example true. |

**Input schema**

```json
{
  "type": "object",
  "required": [
    "topic"
  ],
  "properties": {
    "level": {
      "enum": [
        "any",
        "undergraduate",
        "graduate"
      ],
      "type": "string",
      "default": "any",
      "description": "Course level, for example undergraduate.",
      "examples": [
        "undergraduate",
        "graduate"
      ]
    },
    "topic": {
      "type": "string",
      "minLength": 1,
      "description": "Topic or search words, for example linear algebra.",
      "examples": [
        "linear algebra",
        "quantum mechanics",
        "zxqvnonexistent543210"
      ]
    },
    "max_results": {
      "type": "integer",
      "default": 20,
      "maximum": 100,
      "minimum": 1,
      "description": "Maximum courses to return, for example 20.",
      "x-fous-developer": true,
      "examples": [
        5
      ]
    },
    "with_video_lectures": {
      "type": "boolean",
      "default": false,
      "description": "Only include courses with lecture videos, for example true.",
      "examples": [
        true
      ]
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "level": "undergraduate",
      "topic": "linear algebra",
      "max_results": 5,
      "with_video_lectures": true
    },
    {
      "topic": "linear algebra"
    },
    {
      "level": "graduate",
      "topic": "quantum mechanics",
      "max_results": 5
    }
  ]
}
```

**Output**

| Field | Type | Example | Description |
|---|---|---|---|
| `courses` | array |  | Matching courses in relevance order. |
| `courses[].level` | string or null | `"Undergraduate"` |  |
| `courses[].title` | string | `"Linear Algebra"` |  |
| `courses[].department` | string or null | `"Mathematics"` |  |
| `courses[].course_link` | string | `"https://ocw.mit.edu/courses/18-06sc-linear-algebra-fall-2011/"` |  |
| `courses[].description` | string or null | `"This course covers matrix theory and linear algebra, emphasizing topics useful in other disciplines such as physics, ec` |  |
| `courses[].instructors` | array |  |  |
| `courses[].course_number` | string or null | `"18.06SC"` |  |
| `courses[].semester_year` | string or null | `"Fall 2011"` |  |
| `courses[].available_materials` | array |  |  |

**Example input**

```json
{
  "level": "undergraduate",
  "topic": "linear algebra",
  "max_results": 5,
  "with_video_lectures": true
}
```

**Example output**

```json
{
  "courses": [
    {
      "level": "Undergraduate",
      "title": "Linear Algebra",
      "department": "Mathematics",
      "course_link": "https://ocw.mit.edu/courses/18-06sc-linear-algebra-fall-2011/",
      "description": "This course covers matrix theory and linear algebra, emphasizing topics useful in other disciplines such as physics, economics and social sciences, natural sciences, and engineering. It parallels the …",
      "instructors": [
        "Prof. Gilbert Strang"
      ],
      "course_number": "18.06SC",
      "semester_year": "Fall 2011",
      "available_materials": [
        "Lecture Videos",
        "Lecture Notes",
        "Problem-solving Videos"
      ]
    },
    {
      "level": "Undergraduate",
      "title": "Linear Algebra",
      "department": "Mathematics",
      "course_link": "https://ocw.mit.edu/courses/18-06-linear-algebra-spring-2010/",
      "description": "This is a basic subject on matrix theory and linear algebra. Emphasis is given to topics that will be useful in other disciplines, including systems of equations, vector spaces, determinants, eigenval…",
      "instructors": [
        "Prof. Gilbert Strang"
      ],
      "course_number": "18.06",
      "semester_year": "Spring 2010",
      "available_materials": [
        "Lecture Videos",
        "Instructor Insights",
        "Problem Sets"
      ]
    },
    {
      "level": "Undergraduate",
      "title": "A Vision of Linear Algebra",
      "department": "Mathematics",
      "course_link": "https://ocw.mit.edu/courses/res-18-010-a-2020-vision-of-linear-algebra-spring-2020/",
      "description": "This collection of videos presents Professor Strang’s updated vision of how linear algebra could be taught.",
      "instructors": [
        "Prof. Gilbert Strang"
      ],
      "course_number": "RES.18-010",
      "semester_year": "Spring 2020",
      "available_materials": [
        "Lecture Videos"
      ]
    }
  ]
}
```

## Quick start

Call the API with a Fous API key (`FOUS_API_KEY`). To create one, turn on Developer mode in Fous Studio, then open Keys & connections → API keys (https://app.fous.com/keys).

```bash
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
: "${FOUS_API_KEY:?Set FOUS_API_KEY before running this example}"

curl 'https://api.fous.com/v1/query' \
  --fail-with-body --silent --show-error --max-time 120 \
  -H "Authorization: Bearer $FOUS_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "api": "@mit-opencourseware",
  "visibility": "public",
  "operation": "search_courses",
  "version": 1,
  "input": {
    "level": "undergraduate",
    "topic": "linear algebra",
    "max_results": 5,
    "with_video_lectures": true
  },
  "response": {
    "format": "json"
  }
}'
```

```python
# Save as fous.py and run with python3 fous.py. No packages needed.
# First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
import json
import os
import urllib.error
import urllib.request

api_key = os.environ.get("FOUS_API_KEY")
if not api_key:
    raise RuntimeError("Set FOUS_API_KEY before running this example")

body = json.loads("{\n  \"api\": \"@mit-opencourseware\",\n  \"visibility\": \"public\",\n  \"operation\": \"search_courses\",\n  \"version\": 1,\n  \"input\": {\n    \"level\": \"undergraduate\",\n    \"topic\": \"linear algebra\",\n    \"max_results\": 5,\n    \"with_video_lectures\": true\n  },\n  \"response\": {\n    \"format\": \"json\"\n  }\n}")
request = urllib.request.Request(
    "https://api.fous.com/v1/query",
    data=json.dumps(body).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {api_key}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urllib.request.urlopen(request, timeout=120) as response:
        result = json.load(response)
except urllib.error.HTTPError as error:
    raise RuntimeError(f"HTTP {error.code}: {error.read().decode('utf-8', errors='replace')}") from error
if result.get("success") is False:
    raise RuntimeError(result.get("error", {}).get("message", "Request failed"))
print(json.dumps(result["data"]["output"], indent=2))
```

```typescript
// Save as fous.mts and run with npx tsx fous.mts.
// First set your key: export FOUS_API_KEY='YOUR_FOUS_API_KEY'
const apiKey = process.env.FOUS_API_KEY;
if (!apiKey) throw new Error("Set FOUS_API_KEY before running this example");

const response = await fetch("https://api.fous.com/v1/query", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${apiKey}`,
    "Content-Type": "application/json",
  },
  signal: AbortSignal.timeout(120_000),
  body: JSON.stringify({
  "api": "@mit-opencourseware",
  "visibility": "public",
  "operation": "search_courses",
  "version": 1,
  "input": {
    "level": "undergraduate",
    "topic": "linear algebra",
    "max_results": 5,
    "with_video_lectures": true
  },
  "response": {
    "format": "json"
  }
}),
});
type ApiResult = { success: boolean; data?: { output: unknown }; error?: { message: string } };
const result: ApiResult = await response.json();
if (!response.ok || result.success === false) {
  throw new Error(result.error?.message ?? `HTTP ${response.status}`);
}
if (!result.data) throw new Error("Missing API response data");
console.log(result.data.output);
```

Or describe the data in plain language: send `{"api":"@mit-opencourseware","prompt":"Describe the data you need, with every detail"}` to the same URL. Fous fills in the input, runs the method that fits and returns only the fields you asked for; `data.route.calls[].request` is the exact call it made. Routing is free; the run costs the same.

## Use cases

- Find MIT courses on a subject
- Identify courses with lecture videos
- Compare courses by level and department
- Review course instructors and available materials

## FAQ

### Is Fous affiliated with MIT OpenCourseWare?

No. Fous is not affiliated with MIT OpenCourseWare. This workflow reads the public ocw.mit.edu website and returns its data.

### How much does it cost?

Each run costs 1 credit. With pay-as-you-go, a credit costs 1¢; monthly plans cost less per credit.

### Do I need a MIT OpenCourseWare account?

No. You only need a Fous account.

### How current is the data?

Fous gets the data from ocw.mit.edu when you run it; repeating the same request within a day may return the saved result. Fous checks this workflow automatically; it last passed a check on Sep 29, 2026.

### What MIT courses cover a topic?

Search courses finds matching courses for a required topic or search words, ordered by relevance.

### Which courses include lecture videos?

Search courses can return only courses with lecture videos when that filter is enabled.

### What materials are available for a course?

Search courses returns available materials for each matching course.

## Related

- [Coursera API](https://fous.com/workflows/coursera.md): Coursera offers courses, certificates, projects, and degrees; search results follow Coursera’s order, and publicly displayed prices and availability may vary by location.
- [Class Central API](https://fous.com/workflows/class-central.md): Find online courses across learning platforms.
- [Udemy API](https://fous.com/workflows/udemy.md): Online courses in professional and personal skills.
- [Open Library API](https://fous.com/workflows/open-library.md): Open Library returns book search results, catalog details, and author works; availability reflects listed editions, not current loan availability, and catalog details may be missing.
- [College Scorecard API](https://fous.com/workflows/college-scorecard.md): College Scorecard returns US college costs and outcomes, including admissions, graduation, debt, and earnings; some figures may be missing, and comparisons cover 2–5 colleges.
- [OpenAlex API](https://fous.com/workflows/openalex.md): OpenAlex is an open catalog of scholarly research and connections, offering ranked papers and institution research summaries with annual output, leading topics, and coauthors.
- [QS Top Universities API](https://fous.com/workflows/qs-top-universities.md): QS Top Universities provides rankings and profiles with latest world ranks, student figures, up to five subject ranks and listed tuition; subject editions may differ.
- [Open Charge Map API](https://fous.com/workflows/open-charge-map.md): Public electric-vehicle charging location listings.
- [All Education workflows](https://fous.com/workflows/category/education)
