# Quotes API
> A collection of 1,600+ famous quotes from 600+ authors. Fetch a random quote (optionally filtered by author), look one up by id, search the full collection by text or author, and browse the author directory. Perfect for daily-quote widgets, dashboards, apps and inspiration features.

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

## Pricing
- **Free** (Free) — 2,000 calls/Mo, 3 req/s
- **Starter** ($4/Mo) — 40,000 calls/Mo, 8 req/s
- **Pro** ($11/Mo) — 200,000 calls/Mo, 20 req/s
- **Mega** ($30/Mo) — 1,000,000 calls/Mo, 40 req/s

## Endpoints

### Quotes

#### `GET /v1/quote` — A single quote by id

**Parameters:**
- `id` (query, required, string) — Quote id Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/quotes-api/v1/quote?id=0"
```

**Response:**
```json
{
    "data": {
        "id": 0,
        "text": "Genius is one percent inspiration and ninety-nine percent perspiration.",
        "author": "Thomas Edison"
    },
    "meta": {
        "timestamp": "2026-05-31T01:46:11.771Z",
        "request_id": "4fb4a74f-c4dc-46ad-a600-d4bdd0436755"
    },
    "status": "ok",
    "message": "Quote retrieved",
    "success": true
}
```

#### `GET /v1/random` — A random quote (optionally by author)

**Parameters:**
- `author` (query, optional, string) — Filter by author name
- `count` (query, optional, string) — Number of quotes (1-20, default 1)

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

**Response:**
```json
{
    "data": {
        "id": 1463,
        "text": "The mark of your ignorance is the depth of your belief in injustice and tragedy. What the caterpillar calls the end of the world, the Master calls the butterfly.",
        "author": "Richard Bach"
    },
    "meta": {
        "timestamp": "2026-05-31T01:46:11.849Z",
        "request_id": "1d585001-f8e6-411d-b893-434df085df80"
    },
    "status": "ok",
    "message": "Quote retrieved",
    "success": true
}
```

#### `GET /v1/search` — Search quotes by text and author

**Parameters:**
- `q` (query, optional, string) — Text to search Example: `success`
- `author` (query, optional, string) — Author name (substring)
- `limit` (query, optional, string) — Results per page (1-100, default 20) Example: `20`
- `offset` (query, optional, string) — Pagination offset Example: `0`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/quotes-api/v1/search?q=success&limit=20&offset=0"
```

**Response:**
```json
{
    "data": {
        "count": 20,
        "limit": 20,
        "total": 55,
        "offset": 0,
        "filters": {
            "q": "success",
            "author": null
        },
        "results": [
            {
                "id": 35,
                "text": "One fails forward toward success.",
                "author": "Charles Kettering"
            },
            {
                "id": 64,
                "text": "When performance exceeds ambition, the overlap is called success.",
                "author": "Cullen Hightower"
            },
            {
                "id": 213,
                "text": "The path to success is to take massive, determined action.",
                "author": "Tony Robbins"
            },
            {
                "id": 258,
                "text": "The secret of success is constancy to purpose.",
                "author": "Benjamin Disraeli"
            },
            {
                "id": 295,
                "text": "Successful people ask better questions, and as a result, they get better answers.",
                "author": "Tony Robbins"
            },
            {
                "id": 316,
                "text": "Through perseverance many people win success out of what seemed destined to be certain failure.",
                "author": "Benjamin Disraeli"
            },
            {
                "id": 332,
                "text": "Most great people have attained their greatest success just one step beyond their
…(truncated, see openapi.json for full schema)
```

### Authors

#### `GET /v1/authors` — Author directory with quote counts

**Parameters:**
- `q` (query, optional, string) — Filter authors by name
- `limit` (query, optional, string) — Max authors (1-500, default 50) Example: `50`

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/quotes-api/v1/authors?limit=50"
```

**Response:**
```json
{
    "data": {
        "count": 50,
        "total": 675,
        "authors": [
            {
                "author": "Buddha",
                "quotes": 56
            },
            {
                "author": "Byron Pulsifer",
                "quotes": 41
            },
            {
                "author": "Confucius",
                "quotes": 37
            },
            {
                "author": "Ralph Emerson",
                "quotes": 36
            },
            {
                "author": "Lao Tzu",
                "quotes": 35
            },
            {
                "author": "Richard Bach",
                "quotes": 32
            },
            {
                "author": "Albert Einstein",
                "quotes": 27
            },
            {
                "author": "Wayne Dyer",
                "quotes": 25
            },
            {
                "author": "Napoleon Hill",
                "quotes": 25
            },
            {
                "author": "Dalai Lama",
                "quotes": 23
            },
            {
                "author": "Epictetus",
                "quotes": 21
            },
            {
                "author": "Abraham Lincoln",
                "quotes": 17
            },
            {
                "author": "Johann Wolfgang von Goethe",
                "quotes": 16
            },
            {
                "author": "Marcus Aurelius",
                "quotes": 16
            },
            {

…(truncated, see openapi.json for full schema)
```

### Meta

#### `GET /v1/meta` — Totals & source

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

**Response:**
```json
{
    "data": {
        "total": 1638,
        "fields": [
            "id",
            "text",
            "author"
        ],
        "source": "Curated public-domain quotes collection",
        "authors": 675
    },
    "meta": {
        "timestamp": "2026-05-31T01:46:12.044Z",
        "request_id": "c35cf5cb-e8d7-47cd-8104-30f6da2fc586"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


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