# Wikipedia API
> A fast, clean wrapper over the official Wikimedia APIs covering every Wikipedia language: full-text article search with snippets, lead-section summaries (extract, short description, thumbnail and canonical URL), "on this day" historical events, births, deaths and holidays for any calendar day, and a random-article endpoint. Every endpoint takes a "lang" parameter (en, de, fr, es, simple, zh and any other Wikipedia language) and accepts input via the query string or the request body. Returns lean, predictable JSON with HTML stripped and entities decoded — no scraping, no rate-limit juggling, no client-side parsing. Ideal for chatbots and RAG pipelines, trivia and "this day in history" apps, knowledge panels, education and research tools.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/wiki-api/..."
```

## Pricing
- **Free** (Free) — 5,000 calls/Mo, 2 req/s
- **Basic** ($6/Mo) — 75,000 calls/Mo, 10 req/s
- **Pro** ($19/Mo) — 500,000 calls/Mo, 25 req/s
- **Mega** ($49/Mo) — 3,000,000 calls/Mo, 75 req/s

## Endpoints

### Wikipedia

#### `GET /v1/onthisday` — On-this-day events/births/deaths/holidays

**Parameters:**
- `type` (query, optional, string) — events|births|deaths|holidays|selected|all Example: `events`
- `month` (query, optional, string) — Month 1..12 (default today) Example: `7`
- `day` (query, optional, string) — Day 1..31 (default today) Example: `20`
- `lang` (query, optional, string) — Wikipedia language code Example: `en`
- `limit` (query, optional, string) — Max 1..100 Example: `20`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wiki-api/v1/onthisday?type=events&month=7&day=20&lang=en&limit=20"
```

#### `GET /v1/random` — Random article summary

**Parameters:**
- `lang` (query, optional, string) — Wikipedia language code Example: `en`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wiki-api/v1/random?lang=en"
```

#### `GET /v1/search` — Full-text article search

**Parameters:**
- `q` (query, required, string) — Search term Example: `quantum computing`
- `lang` (query, optional, string) — Wikipedia language code Example: `en`
- `limit` (query, optional, string) — Max results 1..50 Example: `10`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wiki-api/v1/search?q=quantum+computing&lang=en&limit=10"
```

#### `GET /v1/summary` — Article summary (extract + thumbnail)

**Parameters:**
- `title` (query, required, string) — Article title Example: `Albert Einstein`
- `lang` (query, optional, string) — Wikipedia language code Example: `en`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wiki-api/v1/summary?title=Albert+Einstein&lang=en"
```


---
Marketplace page: https://www.oanor.com/api/wiki-api
OpenAPI spec: https://www.oanor.com/api/wiki-api/openapi.json
