---
title: "Quick Start"
description: "Make your first API call to the Quote Gallery API in under 5 minutes."
canonical_url: "https://docs.quotegallery.nl/docs/getting-started/quickstart"
---
# Quick Start

> Make your first API call to the Quote Gallery API in under 5 minutes.

This guide walks you through making your first requests. You’ll need a [Quote Gallery account](https://quotegallery.nl/auth/login) and an API key before you start - see [Authentication](https://docs.quotegallery.nl/docs/getting-started/authentication) if you haven’t set that up yet.

## Set up your API key

Store your key as an environment variable so it’s never hardcoded in your source:

```bash
export QUOTE_GALLERY_API_KEY="your_api_key_here"
```

## Fetch some quotes

<tabs>
<tabs-item label="cURL">

```bash
curl -s -H "X-API-Key: $QUOTE_GALLERY_API_KEY" \
  "https://quotegallery.nl/api/v1/quotes?limit=3"
```

</tabs-item>

<tabs-item label="JavaScript">

```js
const response = await fetch('https://quotegallery.nl/api/v1/quotes?limit=3', {
  headers: { 'X-API-Key': process.env.QUOTE_GALLERY_API_KEY },
})

const { data, pagination } = await response.json()

data.forEach((quote) => {
  console.log(`"${quote.text}" - ${quote.author.name}`)
})
```

</tabs-item>

<tabs-item label="Python">

```python
import os, requests

response = requests.get(
    'https://quotegallery.nl/api/v1/quotes',
    headers={'X-API-Key': os.environ['QUOTE_GALLERY_API_KEY']},
    params={'limit': 3}
)

for quote in response.json()['data']:
    print(f'"{quote["text"]}" - {quote["author"]["name"]}')
```

</tabs-item>
</tabs>

The response looks like this:

```json
{
  "data": [
    {
      "id": "abc123",
      "quoteNumber": 1043,
      "url": "https://quotegallery.nl/quotes/1043-the-only-way-to-do-great-work-is",
      "text": "The only way to do great work is to love what you do.",
      "language": "en",
      "categories": ["wisdom", "success"],
      "likeCount": 42,
      "author": {
        "id": "xyz789",
        "name": "Steve Jobs"
      },
      "createdAt": 1704067200000
    }
  ],
  "pagination": {
    "total": 30,
    "limit": 3,
    "offset": 0,
    "hasMore": true
  }
}
```

## Get a random quote

The random endpoint is perfect for quote-of-the-day features. You can filter by category, and ask for the text in another language:

<tabs>
<tabs-item label="cURL">

```bash
curl -s -H "X-API-Key: $QUOTE_GALLERY_API_KEY" \
  "https://quotegallery.nl/api/v1/quotes/random?language=en"
```

</tabs-item>

<tabs-item label="JavaScript">

```js
const response = await fetch(
  'https://quotegallery.nl/api/v1/quotes/random?language=en',
  { headers: { 'X-API-Key': process.env.QUOTE_GALLERY_API_KEY } }
)

const { data: quote } = await response.json()
console.log(`"${quote.text}" - ${quote.author.name}`)
```

</tabs-item>
</tabs>

## Filter by category, choose a language

Use `categories` to narrow results: slugs are comma-separated and match with OR logic. `language` does not narrow anything; it returns the text in that language where a translation exists.

```bash
curl -s -H "X-API-Key: $QUOTE_GALLERY_API_KEY" \
  "https://quotegallery.nl/api/v1/quotes?language=en&categories=inspirational,wisdom&limit=5"
```

## Search for an author

```bash
curl -s -H "X-API-Key: $QUOTE_GALLERY_API_KEY" \
  "https://quotegallery.nl/api/v1/authors?search=einstein&limit=5"
```

## Paginate through results

The quote, author and playlist lists accept `limit` (max 100) and `offset` for pagination. The quote list does not reach past 8,000 quotes, see [How far the list reaches](https://docs.quotegallery.nl/docs/api/quotes#how-far-the-list-reaches).

```js
async function getAllQuotes(apiKey) {
  const quotes = []
  let offset = 0

  while (true) {
    const response = await fetch(
      `https://quotegallery.nl/api/v1/quotes?limit=100&offset=${offset}`,
      { headers: { 'X-API-Key': apiKey } }
    )

    const { data, pagination } = await response.json()
    quotes.push(...data)

    if (!pagination.hasMore) break
    offset += 100
  }

  return quotes
}
```

## Handle errors

Check the response status on every request. A failed authentication looks like this:

```json
{
  "error": "Invalid API key",
  "code": "INVALID_API_KEY",
  "status": 401
}
```

```js
const response = await fetch('https://quotegallery.nl/api/v1/quotes', {
  headers: { 'X-API-Key': process.env.QUOTE_GALLERY_API_KEY },
})

if (!response.ok) {
  const { error } = await response.json()

  if (response.status === 429) {
    const reset = response.headers.get('X-RateLimit-Reset')
    console.log(`Rate limited - resets at ${new Date(reset * 1000)}`)
  } else if (response.status === 401) {
    console.error('Check your API key')
  } else {
    console.error(`Error ${response.status}: ${error}`)
  }
}
```

<card-group>
<card icon="i-lucide-code" title="API Reference" to="https://docs.quotegallery.nl/docs/api/overview">

Explore every endpoint with parameters and response schemas.

</card>

<card icon="i-lucide-gauge" title="Rate Limits" to="https://docs.quotegallery.nl/docs/guides/rate-limits">

Understand rate limits and choose the right tier.

</card>

<card icon="i-lucide-alert-triangle" title="Error Handling" to="https://docs.quotegallery.nl/docs/guides/error-handling">

A complete guide to error codes and retry patterns.

</card>

<card icon="i-lucide-layout" title="Iframe Embed" to="https://docs.quotegallery.nl/docs/guides/iframe">

Embed a live quote slideshow without exposing your API key.

</card>
</card-group>


## Sitemap

See the full [sitemap](https://docs.quotegallery.nl/sitemap.md) for all pages.
