# Wikisource API
> Wikisource as an API — the Wikimedia free digital library of original source texts. Wikisource collects public-domain and freely-licensed primary texts: classic literature, poetry and plays, historical speeches, treaties and constitutions, religious and philosophical works, landmark court decisions, essays, letters and more, faithfully transcribed. This API wraps the official Wikisource MediaWiki service into clean JSON. /v1/search?q=Gettysburg Address searches the library and returns matching work and page titles with a text snippet and word count. /v1/work?title=Gettysburg Address returns a work's metadata — a short description, a text preview, the total character length and the canonical URL. /v1/text?title=Gettysburg Address (Bliss copy) returns the full plain text of a work (rendered and cleaned from the wiki source, capped at 60,000 characters with a truncated flag when longer) — the actual readable document, including transcribed works that template-based pages assemble. Many works are split into sub-pages or exist in several versions, so use /v1/search to find the exact page title first. Ideal for digital-humanities and literature apps, e-reading and quotation tools, NLP corpora of historical texts, and education. Content is public domain or CC BY-SA. Distinct from book-metadata catalogues and encyclopaedias — this is the actual full text of primary sources and classic works. For free textbooks use the Wikibooks API, for the encyclopaedia the Wikipedia 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/wikisource-api/..."
```

## Pricing
- **Free** (Free) — 3,600 calls/Mo, 2 req/s
- **Starter** ($6/Mo) — 53,000 calls/Mo, 5 req/s
- **Pro** ($17/Mo) — 218,000 calls/Mo, 12 req/s
- **Mega** ($48/Mo) — 755,000 calls/Mo, 35 req/s

## Endpoints

### Texts

#### `GET /v1/search` — Search the source-text library

**Parameters:**
- `q` (query, required, string) — Search text, e.g. Gettysburg Address Example: `Gettysburg Address`
- `limit` (query, optional, string) — Max results (1-50)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wikisource-api/v1/search?q=Gettysburg+Address"
```

**Response:**
```json
{
    "data": {
        "count": 10,
        "query": "Gettysburg Address",
        "results": [
            {
                "url": "https://en.wikisource.org/wiki/Gettysburg_Address",
                "title": "Gettysburg Address",
                "words": 77,
                "snippet": "of Gettysburg Address (1863) by Abraham Lincoln 1Gettysburg Address1863Abraham Lincoln Versions of Gettysburg Address include: Gettysburg Address (1863)"
            },
            {
                "url": "https://en.wikisource.org/wiki/Gettysburg_Address_(Bliss_copy)",
                "title": "Gettysburg Address (Bliss copy)",
                "words": 320,
                "snippet": "Gettysburg Address (1863) Abraham Lincoln 1150278Gettysburg AddressAbraham Lincoln ​Address delivered at the dedication of the cemetery at Gettysburg"
            },
            {
                "url": "https://en.wikisource.org/wiki/Gettysburg_Address_(Nicolay_draft)",
                "title": "Gettysburg Address (Nicolay draft)",
                "words": 299,
                "snippet": "titles, see Gettysburg Address. The Gettysburg address (1863) by Abraham Lincoln, edited by John George Nicolay Abraham Lincoln1150255The Gettysburg address1863John"
            },
            {
                "url": "https://en.wikisource.org/wiki/Gettysburg_Address_(Lincoln_Memorial)",
                "title": "Gettysburg Address (Lincoln Memorial)",
                "words": 330,
                "snippet": "Gettysb
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/text` — Full plain text of a work

**Parameters:**
- `title` (query, required, string) — Work page title, e.g. Gettysburg Address (Bliss copy) Example: `Gettysburg Address (Bliss copy)`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wikisource-api/v1/text?title=Gettysburg+Address+%28Bliss+copy%29"
```

**Response:**
```json
{
    "data": {
        "url": "https://en.wikisource.org/wiki/Gettysburg_Address_(Bliss_copy)",
        "text": "←\n \n\n Gettysburg Address ( 1863 ) Abraham Lincoln \n \n →\n\n sister projects : Wikipedia article , Commons category , Wikidata item \n \n The Bliss copy, once owned by the family of Colonel Alexander Bliss, Bancroft's stepson and publisher of \"Autograph Leaves\", is the only manuscript to which Lincoln affixed his signature.\n\n For works with similar titles, see Gettysburg Address .\n\n 1150278 Gettysburg Address Abraham Lincoln \n\n \n ​ Address delivered at the dedication of the cemetery at Gettysburg.\n\n \nFour score and seven years ago our fathers brought forth, on this continent, a new nation, conceived in Liberty, and dedicated to the proposition that all men are created equal.\n\n Now we are engaged in a great civil war, testing whether that nation, or any nation so conceived and so dedicated, can long endure. We are met on a great battle-field of that war. We have come to dedicate a portion of that field, as a final resting place for those who here gave their lives that that nation might live. It is altogether fitting and proper that we should do this. \n\n But, in a larger sense, we can not ​ dedicate—we can not consecrate—we can not hallow—this ground. The brave men, living and dead, who struggled here, have consecrated it, far above our poor power to add or detract. The world will little note, nor long remember what we say here, but
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/work` — A work metadata & preview

**Parameters:**
- `title` (query, required, string) — Work title, e.g. Gettysburg Address Example: `Gettysburg Address`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wikisource-api/v1/work?title=Gettysburg+Address"
```

**Response:**
```json
{
    "data": {
        "work": {
            "url": "https://en.wikisource.org/wiki/Gettysburg_Address",
            "title": "Gettysburg Address",
            "preview": "Gettysburg Address (1863), Nicolay draft\nGettysburg Address (1863), Hay draft\nGettysburg Address (1864), Everett copy\nGettysburg Address (1864), Bancroft copy\nGettysburg Address (1864), Bliss copy\nGettysburg Address (1922), inscribed on the southern interior wall at the Lincoln Memorial\n\n\n== Works about the Gettysburg Address ==\nInauguration of the Gettysburg Cemetery (1863), report in the Daily Illinois State Journal\n\n\n== See also ==\nGettysburg Oration, a speech given the same day as Lincoln's",
            "characters": 499,
            "description": "speech by U.S. President Abraham Lincoln"
        }
    },
    "meta": {
        "timestamp": "2026-06-01T16:23:35.959Z",
        "request_id": "627f9b54-b86d-4ca5-950d-e9d74ac702de"
    },
    "status": "ok",
    "message": "Work retrieved",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Usage notes

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wikisource-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "Wikisource is Wikimedia's free digital library of original source texts — classic literature, poems and plays, historical speeches, treaties and constitutions, religious and philosophical works, court decisions, essays and more, all public-domain or freely licensed. /v1/search?q=Gettysburg Address = search the library, returning matching work/page titles with a snippet and word count; /v1/work?title=Gettysburg Address = a work's metadata (short description, a text preview, total character length and URL); /v1/text?title=Gettysburg Address = the full plain text of a work (capped at 60,000 characters, with a truncated flag when longer). Titles are Wikisource page names — many works are split into sub-pages or have multiple versions, so use /v1/search to find the exact page. Content is public domain or CC BY-SA. Distinct from book-metadata catalogues and encyclopaedias — this is the actual full text of primary sources and classic works. For free textbooks use the Wikibooks API, for the encyclopaedia the Wikipedia API.",
        "source": "Wikisource — the free library of source texts (en.wikisource.org, a Wikimedia project)",
        "endpoints": [
            "/v1/search",
            "/v1/work",
            "/v1/text",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T16:23:36.044Z",
        "request_id": "8effa824-0931-40d0-b05a-4cdfd86df34f"
    },
    "status": "ok",
    "message": "Meta retrieved
…(truncated, see openapi.json for full schema)
```


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