# Wikipedia API
> Search Wikipedia and fetch concise article summaries, page media, "on this day" historical events and random articles — across all Wikipedia languages, via the official Wikimedia API.

## 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/wikipedia-api/..."
```

## Pricing
- **Free** (Free) — 10,000 calls/Mo, 2 req/s
- **Basic** ($7/Mo) — 75,000 calls/Mo, 10 req/s
- **Pro** ($19/Mo) — 300,000 calls/Mo, 25 req/s
- **Mega** ($49/Mo) — 1,000,000 calls/Mo, 50 req/s

## Endpoints

### Search

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

**Parameters:**
- `q` (query, required, string) — Search text Example: `Alan Turing`
- `limit` (query, optional, string) — Max results (1-50) Example: `10`
- `lang` (query, optional, string) — Wikipedia language code Example: `en`

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

**Response:**
```json
{
    "data": {
        "count": 10,
        "pages": [
            {
                "id": 1208,
                "key": "Alan_Turing",
                "title": "Alan Turing",
                "excerpt": "algorithm and computation with the <span class=\"searchmatch\">Turing</span> machine, which can be considered a model of a general-purpose computer. <span class=\"searchmatch\">Turing</span> is widely considered to be the father",
                "thumbnail": "//upload.wikimedia.org/wikipedia/commons/thumb/c/ce/Alan_turing_header.jpg/60px-Alan_turing_header.jpg",
                "description": "English computer scientist (1912–1954)"
            },
            {
                "id": 31093,
                "key": "Turing_Award",
                "title": "Turing Award",
                "excerpt": "Staff (2014). &quot;ACM&#039;s <span class=\"searchmatch\">Turing</span> Award prize raised to $1 million&quot;. Communications of the ACM. 57 (12): 20. doi:10.1145/2685372. &quot;A. M. <span class=\"searchmatch\">Turing</span> Award&quot;. Association",
                "thumbnail": "//upload.wikimedia.org/wikipedia/commons/thumb/7/76/Turing_statue_Surrey.jpg/60px-Turing_statue_Surrey.jpg",
                "description": "American annual computer science prize"
            },
            {
                "id": 54756168,
                "key": "Alan_Turing:_The_Enigma",
                "title": "Alan Turing: The Enigma",
                "excerpt": "Annotated <span class=\"searchmat
…(truncated, see openapi.json for full schema)
```

### Articles

#### `GET /v1/media` — Images/media on a page

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

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wikipedia-api/v1/media?title=Berlin&lang=en"
```

**Response:**
```json
{
    "data": {
        "count": 82,
        "items": [
            {
                "type": "image",
                "title": "File:Museumsinsel_Berlin_Juli_2021_1_(cropped)_b.jpg",
                "srcset": [
                    "//upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Museumsinsel_Berlin_Juli_2021_1_%28cropped%29_b.jpg/500px-Museumsinsel_Berlin_Juli_2021_1_%28cropped%29_b.jpg",
                    "//upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Museumsinsel_Berlin_Juli_2021_1_%28cropped%29_b.jpg/1280px-Museumsinsel_Berlin_Juli_2021_1_%28cropped%29_b.jpg"
                ],
                "caption": null,
                "lead_image": true
            },
            {
                "type": "image",
                "title": "File:Berlin_-_Schloss_Charlottenburg_Reiterstandbild_&_Schlossturm.jpg",
                "srcset": [
                    "//upload.wikimedia.org/wikipedia/commons/thumb/c/cf/Berlin_-_Schloss_Charlottenburg_Reiterstandbild_%26_Schlossturm.jpg/500px-Berlin_-_Schloss_Charlottenburg_Reiterstandbild_%26_Schlossturm.jpg"
                ],
                "caption": null,
                "lead_image": false
            },
            {
                "type": "image",
                "title": "File:Berlin_-_Siegessäule1.jpg",
                "srcset": [
                    "//upload.wikimedia.org/wikipedia/commons/thumb/3/30/Berlin_-_Siegess%C3%A4ule1.jpg/500px-Berlin_-_Siegess%C3%A4ule1.jpg",
                    "//upload.wikimedia.org/w
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/summary` — Concise page summary

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

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

**Response:**
```json
{
    "data": {
        "lang": "en",
        "title": "Berlin",
        "extract": "Berlin is the capital of Germany, as well as its largest city by both area and population. With 4 million inhabitants, it has the highest population within its city limits of any city in the European Union. The city is also one of the states of Germany, being the third-smallest state in the country by area. Berlin is surrounded by the state of Brandenburg, bordering Brandenburg's capital Potsdam to the southwest. The urban area of Berlin has a population of over 5 million, making it the most populous in Germany. The Berlin-Brandenburg capital region has around 6 million inhabitants and is Germany's second-largest metropolitan region after the Rhine-Ruhr region, as well as the fifth-biggest metropolitan region by GDP in the European Union.",
        "page_url": "https://en.wikipedia.org/wiki/Berlin",
        "thumbnail": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Museumsinsel_Berlin_Juli_2021_1_%28cropped%29_b.jpg/330px-Museumsinsel_Berlin_Juli_2021_1_%28cropped%29_b.jpg",
        "coordinates": {
            "lat": 52.52,
            "lon": 13.405
        },
        "description": "Capital and largest city of Germany",
        "wikibase_item": "Q64",
        "original_image": "https://upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Museumsinsel_Berlin_Juli_2021_1_%28cropped%29_b.jpg/3840px-Museumsinsel_Berlin_Juli_2021_1_%28cropped%29_b.jpg"
    },
    "meta": {
        "tim
…(truncated, see openapi.json for full schema)
```

### Discovery

#### `GET /v1/on-this-day` — Historical events for a date

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

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

**Response:**
```json
{
    "data": {
        "date": "07-20",
        "type": "events",
        "events": [
            {
                "text": "American businessman Jeff Bezos flies to space aboard New Shepard NS-16 operated by his private spaceflight company Blue Origin.",
                "year": 2021,
                "pages": [
                    {
                        "title": "Jeff_Bezos",
                        "extract": "Jeffrey Preston Bezos is an American businessman, the founder, executive chairman, and former president and CEO of Amazon, the world's largest e-commerce and cloud computing company. According to estimates published by the Bloomberg Billionaires Index and Forbes in 2026, Bezos's net worth was estimated at approximately US$284.1 billion, placing him among the world's wealthiest individuals by those rankings. He was the wealthiest person from 2017 to 2021, according to Forbes and the Bloomberg Billionaires Index.",
                        "page_url": "https://en.wikipedia.org/wiki/Jeff_Bezos"
                    },
                    {
                        "title": "New_Shepard",
                        "extract": "New Shepard is a fully reusable sub-orbital launch vehicle developed for space tourism by Blue Origin. The vehicle is named after Alan Shepard, for being the first American to travel into space, also being the fifth person to walk on the Moon. The vehicle is capable of vertical takeoff and landings. Additionally, it is also capable of carrying humans a
…(truncated, see openapi.json for full schema)
```

#### `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/wikipedia-api/v1/random?lang=en"
```

**Response:**
```json
{
    "data": {
        "lang": "en",
        "title": "Crassispira hondurasensis",
        "extract": "Crassispira hondurasensis is a species of sea snail, a marine gastropod mollusk in the family Pseudomelatomidae.",
        "page_url": "https://en.wikipedia.org/wiki/Crassispira_hondurasensis",
        "thumbnail": "https://upload.wikimedia.org/wikipedia/commons/3/38/Crassispira_hondurasensis_001.jpg",
        "coordinates": null,
        "description": "Species of gastropod",
        "wikibase_item": "Q13500454",
        "original_image": "https://upload.wikimedia.org/wikipedia/commons/3/38/Crassispira_hondurasensis_001.jpg"
    },
    "meta": {
        "timestamp": "2026-05-29T20:26:40.453Z",
        "request_id": "6316b182-7582-4744-81f5-95315dcd3426"
    },
    "status": "ok",
    "message": "Random article retrieved successfully",
    "success": true
}
```


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