# Wolfram|Alpha

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

> Computational knowledge engine — math, science, geography, history, nutrition, finance, and more. Get answers as text, spoken audio, LLM-optimized data, or full structured results.

**Category:** Data / Knowledge | **Website:** [www.wolframalpha.com](https://www.wolframalpha.com) | **Docs:** [products.wolframalpha.com/api](https://products.wolframalpha.com/api)

## Access Methods

| Method | Base URL | Auth |
|--------|----------|------|
| **MPP (Tempo)** | `https://wolframalpha.mpp.paywithlocus.com/wolframalpha/` | HTTP 402 auto-payment |
| **Wrapped API** | `https://beta-api.paywithlocus.com/api/wrapped/wolframalpha/` | `Authorization: Bearer <LOCUS_API_KEY>` |

**OpenAPI discovery:** `GET https://wolframalpha.mpp.paywithlocus.com/openapi.json`

## Endpoints

### Short Answer

Get a brief plain text answer to any question. Returns a single line of text — ideal for quick lookups and calculations.

**Estimated cost:** $0.055

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `i` | string | Yes | Natural language query (e.g. "population of france", "distance to mars") |
| `units` | string | No | "metric" or "imperial" |
| `timeout` | number | No | Max seconds to process (default 5) |

```bash
curl -X POST https://wolframalpha.mpp.paywithlocus.com/wolframalpha/short-answer \
  -H "Content-Type: application/json" \
  -d '{"i":"<string>","units":"<string>","timeout":"<number>"}'
```

### Spoken Result

Get an answer phrased as a full sentence — optimized for text-to-speech and conversational AI. Returns natural language text.

**Estimated cost:** $0.055

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `i` | string | Yes | Natural language query |
| `units` | string | No | "metric" or "imperial" |
| `timeout` | number | No | Max seconds to process (default 5) |

```bash
curl -X POST https://wolframalpha.mpp.paywithlocus.com/wolframalpha/spoken \
  -H "Content-Type: application/json" \
  -d '{"i":"<string>","units":"<string>","timeout":"<number>"}'
```

### Full Results

Get comprehensive structured results as JSON with multiple pods of data, images, and metadata. The most powerful Wolfram|Alpha endpoint.

**Estimated cost:** $0.055

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `input` | string | Yes | Natural language query |
| `format` | string | No | Output format: "plaintext", "image", "mathml" (default: "plaintext,image") |
| `includepodid` | string | No | Only include pods with this ID (e.g. "Result") |
| `excludepodid` | string | No | Exclude pods with this ID |
| `units` | string | No | "metric" or "nonmetric" |
| `location` | string | No | Location for context (e.g. "Boston, MA") |
| `timeout` | number | No | Max seconds (default 5) |

```bash
curl -X POST https://wolframalpha.mpp.paywithlocus.com/wolframalpha/full-results \
  -H "Content-Type: application/json" \
  -d '{"input":"<string>","format":"<string>","includepodid":"<string>","excludepodid":"<string>","units":"<string>","location":"<string>","timeout":"<number>"}'
```

### Simple (Image)

Get the full Wolfram|Alpha result page as a single image. Returns a GIF/PNG image with all pods rendered visually.

**Estimated cost:** $0.055

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `i` | string | Yes | Natural language query |
| `width` | number | No | Image width in pixels (default 500) |
| `fontsize` | number | No | Font size in points (default 14) |
| `background` | string | No | Background color (e.g. "F5F5F5", "transparent") |
| `foreground` | string | No | "black" (default) or "white" |
| `layout` | string | No | "divider" (default) or "labelbar" |
| `units` | string | No | "metric" or "imperial" |

```bash
curl -X POST https://wolframalpha.mpp.paywithlocus.com/wolframalpha/simple \
  -H "Content-Type: application/json" \
  -d '{"i":"<string>","width":"<number>","fontsize":"<number>","background":"<string>","foreground":"<string>","layout":"<string>","units":"<string>"}'
```
