# Planetmath — 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.

> Search and browse mathematical definitions, theorems, and concepts across PlanetMath's encyclopedia by subject classification or keyword, then explore how topics relate to and depend on each other. Access detailed entry information organized through the Mathematical Subject Classification hierarchy to understand foundational concepts and build your mathematical knowledge.

**Category:** Education | **Website:** [planetmath.org/](https://planetmath.org/) | **Docs:** [parse.bot/marketplace/d383cf55-55fd-4d0f-9ace-0e6566a63075/planetmath-org-api](https://parse.bot/marketplace/d383cf55-55fd-4d0f-9ace-0e6566a63075/planetmath-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-planetmath-org-api-d383cf55/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_alphabetical_index

Scrape the full alphabetical index of PlanetMath entries, returning entries grouped by their first character (0-9, A-Z). Each group is an array of entry summaries with canonical_name and title. A single network round-trip fetches the entire index. Returns a single AlphabeticalIndex object whose `groups` field is a dict keyed by first character.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-planetmath-org-api-d383cf55/get_alphabetical_index \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_entries_by_msc_category

Get all entries (canonical names and titles) for a specific MSC category code. Matches categories with or without leading zeros (e.g. '03' and '3' both match Mathematical Logic). Returns the matched category code and an array of entry summaries.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `category_code` | string | Yes | MSC category code such as '03', '11', '54'. Leading zeros are preserved and matched flexibly. |

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

### get_entry

Fetch a single encyclopedia entry by its canonical name (slug). Returns title, full HTML and text content, metadata (MSC classification, related topics, definitions, author, dates), and keywords. Canonical names are case-sensitive; both lowercase ('axiom') and CamelCase ('FermatsLittleTheorem') forms are used on the site.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `canonical_name` | string | Yes | The canonical name/slug of the entry. Case-sensitive; both lowercase ('axiom') and CamelCase ('FermatsLittleTheorem') forms are used. |

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

### get_entry_related_topics

Extract the 'Related topic' and 'Defines' metadata fields from a given entry. Returns arrays of related topic canonical names and defined term canonical names. Useful for building dependency graphs between mathematical concepts.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `canonical_name` | string | Yes | The canonical name/slug of the entry. |

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

### get_msc_hierarchy

Returns the full list of top-level MSC (Mathematics Subject Classification) codes and names used by PlanetMath. There are approximately 60 top-level categories. A single network round-trip fetches the entire hierarchy.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-planetmath-org-api-d383cf55/get_msc_hierarchy \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### get_subject_index

Scrape the full MSC (Mathematics Subject Classification) subject index, returning all top-level subject categories with the entries listed under each. Each category contains its MSC code, human-readable name, HTML anchor ID, and a list of entry summaries. Returns approximately 60 categories. A single network round-trip fetches the entire index.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-planetmath-org-api-d383cf55/get_subject_index \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### search_entries

Search for PlanetMath entries by keyword in their title or canonical name. For multi-word queries, all words must appear in the title or slug (AND logic). Matching is case-insensitive substring matching. Returns all matches from the full alphabetical index in a single page.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `query` | string | Yes | Search keyword or space-separated keywords. Each word is matched as a substring against entry titles and canonical names. |

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