# Openstax — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Access learning outcomes, table of contents, and metadata from 60+ free OpenStax textbooks spanning Business, Science, Math, Social Sciences, Humanities, Computer Science, and Nursing. Search and retrieve structured content from any of these textbooks.

**Category:** Education | **Website:** [openstax.org/subjects](https://openstax.org/subjects) | **Docs:** [parse.bot/marketplace/c4b2a76e-df44-4c90-862a-f2e6dd74ab32/openstax-org-api](https://parse.bot/marketplace/c4b2a76e-df44-4c90-862a-f2e6dd74ab32/openstax-org-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-openstax-org-api-c4b2a76e/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_book_toc

Get the full table of contents (chapter/section hierarchy) for a specific OpenStax textbook. Returns nested chapters with their sections including titles and slugs. Each chapter contains an array of sections; each section has a title and slug for deep-linking. Use the book slug from list_books.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `book_slug` | string | Yes | Book slug identifier from list_books results (e.g., 'introduction-sociology-3e', 'biology-2e', 'principles-finance'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-openstax-org-api-c4b2a76e/get_book_toc \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"book_slug":"<string>"}'
```

### get_learning_outcomes

Extract all learning outcomes/objectives for a specific OpenStax textbook. Returns verbatim learning outcome statements organized by chapter and section. Optionally filter by chapter number to reduce response size for large books. Each section lists its learning outcomes as an array of strings.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `book_slug` | string | Yes | Book slug identifier from list_books results (e.g., 'introduction-sociology-3e', 'biology-2e'). |
| `chapter` | string | No | Filter to a specific chapter number (e.g., '1', '2', '3'). If omitted, returns all chapters. Recommended for large books to avoid timeouts. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-openstax-org-api-c4b2a76e/get_learning_outcomes \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"book_slug":"<string>","chapter":"<string>"}'
```

### list_books

List all available OpenStax textbooks with their titles, slugs, subjects, and content IDs. Optionally filter by subject area. Returns only books with 'live' or 'new_edition_available' state. No pagination — the full catalog (~60 books) is returned in one response.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `subject` | string | No | Filter by subject area. Case-insensitive partial match against book subjects. Common values include 'Business', 'Science', 'Math', 'Social Sciences', 'Humanities', 'Computer Science'. If omitted or empty, returns all live books. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-openstax-org-api-c4b2a76e/list_books \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"subject":"<string>"}'
```
