# Wikibooks API
> Wikibooks as an API — the Wikimedia library of free, open-content textbooks, manuals and learning guides, community-written and freely licensed. Wikibooks covers programming and computer science, mathematics, the natural and social sciences, languages, engineering, cooking, music and much more, organised as books made up of chapters. This API wraps the official Wikibooks MediaWiki service into clean JSON. /v1/search?q=python programming searches the library and returns matching book and chapter titles with a text snippet and word count. /v1/book?title=Python Programming returns a book's overview — its short description, the plain-text introduction, a cover thumbnail and the canonical URL. /v1/chapters?title=Python Programming lists the book's chapters (its subpages, e.g. Python Programming/Operators, Python Programming/Classes), each with the chapter name and URL, so you can browse and present a whole book's structure. Titles are Wikibooks page names; get the exact title from /v1/search first. Ideal for e-learning platforms and study apps, open-education and OER tools, reading lists, and developer/teaching content aggregators. Content is licensed CC BY-SA by the Wikibooks community. Distinct from book-metadata catalogues — this is actual free educational content. For travel guides see the Wikivoyage 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/wikibooks-api/..."
```

## Pricing
- **Free** (Free) — 3,500 calls/Mo, 2 req/s
- **Starter** ($6/Mo) — 52,000 calls/Mo, 5 req/s
- **Pro** ($18/Mo) — 215,000 calls/Mo, 12 req/s
- **Mega** ($50/Mo) — 760,000 calls/Mo, 35 req/s

## Endpoints

### Books

#### `GET /v1/book` — A book overview

**Parameters:**
- `title` (query, required, string) — Book title, e.g. Python Programming Example: `Python Programming`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wikibooks-api/v1/book?title=Python+Programming"
```

**Response:**
```json
{
    "data": {
        "book": {
            "url": "https://en.wikibooks.org/wiki/Python_Programming",
            "title": "Python Programming",
            "overview": "This book describes Python, an open-source general-purpose interpreted programming language available for the most popular  operating systems. The current versions are 3.x while versions 2.x are no longer supported, since 2020. This book describes primarily the versions 3.x, but does at times reference versions 2.x.\nThere are a few implementations of Python 3 (all of which also support Python 2):\n\nCPython, the standard implementation written in C.\nPyPy, a JIT-compiled version written in RPython (a subset of Python).\nIronPython, a C# implementation that runs on the .NET environment.\nNuitka, a Python 3 to C 11 transpiler.\nJython, a Java implementation is also available, however it only supports Python 2.",
            "thumbnail": null,
            "description": "general-purpose programming language"
        }
    },
    "meta": {
        "timestamp": "2026-06-01T16:23:36.818Z",
        "request_id": "c7e78947-8fed-429d-ae04-72a78edfed7c"
    },
    "status": "ok",
    "message": "Book retrieved",
    "success": true
}
```

#### `GET /v1/chapters` — A book chapters (subpages)

**Parameters:**
- `title` (query, required, string) — Book title, e.g. Python Programming Example: `Python Programming`
- `limit` (query, optional, string) — Max chapters (1-500)

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/wikibooks-api/v1/chapters?title=Python+Programming"
```

**Response:**
```json
{
    "data": {
        "book": "Python Programming",
        "count": 82,
        "chapters": [
            {
                "url": "https://en.wikibooks.org/wiki/Python_Programming%2FOperators",
                "title": "Python Programming/Operators",
                "chapter": "Operators"
            },
            {
                "url": "https://en.wikibooks.org/wiki/Python_Programming%2FClasses",
                "title": "Python Programming/Classes",
                "chapter": "Classes"
            },
            {
                "url": "https://en.wikibooks.org/wiki/Python_Programming%2FPrint_version",
                "title": "Python Programming/Print version",
                "chapter": "Print version"
            },
            {
                "url": "https://en.wikibooks.org/wiki/Python_Programming%2FLists",
                "title": "Python Programming/Lists",
                "chapter": "Lists"
            },
            {
                "url": "https://en.wikibooks.org/wiki/Python_Programming%2FInput_and_Output",
                "title": "Python Programming/Input and Output",
                "chapter": "Input and Output"
            },
            {
                "url": "https://en.wikibooks.org/wiki/Python_Programming%2FStrings",
                "title": "Python Programming/Strings",
                "chapter": "Strings"
            },
            {
                "url": "https://en.wikibooks.org/wiki/Python_Programming%2FGetting_Python",
                
…(truncated, see openapi.json for full schema)
```

#### `GET /v1/search` — Search the textbook library

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

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

**Response:**
```json
{
    "data": {
        "count": 10,
        "query": "python programming",
        "results": [
            {
                "url": "https://en.wikibooks.org/wiki/Python_Programming",
                "title": "Python Programming",
                "words": 286,
                "snippet": "This book describes Python, an open-source general-purpose interpreted programming language available for the most popular operating systems. The current"
            },
            {
                "url": "https://en.wikibooks.org/wiki/Python_Programming%2FCreating_Python_Programs",
                "title": "Python Programming/Creating Python Programs",
                "words": 835,
                "snippet": "Welcome to Python! This tutorial will show you how to start writing programs. Python programs are nothing more than text files, and they may be edited"
            },
            {
                "url": "https://en.wikibooks.org/wiki/Introduction_to_Python_Programming%2FIntroduction",
                "title": "Introduction to Python Programming/Introduction",
                "words": 676,
                "snippet": "semicolons, the need to compile the program and then run the program as one needs to be do in C, C++, Java programming. Python interpreter tracks the errors"
            },
            {
                "url": "https://en.wikibooks.org/wiki/Python_Programming%2FGUI_Programming",
                "title": "Python Programming/GUI Programming",
                "words": 748,
…(truncated, see openapi.json for full schema)
```

### Meta

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

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

**Response:**
```json
{
    "data": {
        "note": "Wikibooks is Wikimedia's library of free, community-written textbooks, manuals and learning guides — programming, mathematics, languages, sciences, cooking, music and much more. /v1/search?q=python programming = search the library, returning matching book/page titles with a snippet and word count; /v1/book?title=Python Programming = a book's overview (its description and plain-text introduction, a cover thumbnail and the URL); /v1/chapters?title=Python Programming = the book's chapters, i.e. its subpages (e.g. Python Programming/Operators, Python Programming/Classes), each with the chapter name and URL — so you can browse a whole book's structure. Titles are Wikibooks page names; get the exact title from /v1/search first. Content is licensed CC BY-SA by the Wikibooks community. Distinct from book-metadata catalogues — this is actual free educational content. For travel guides use Wikivoyage, for the encyclopaedia use Wikipedia.",
        "source": "Wikibooks — free open-content textbooks (en.wikibooks.org, a Wikimedia project)",
        "endpoints": [
            "/v1/search",
            "/v1/book",
            "/v1/chapters",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T16:23:37.445Z",
        "request_id": "80c66a09-d3c0-4add-a19a-757c95a9326d"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


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