API Documentation

Everything you need to integrate Airquote into your application.

Quick Start

Make your first API call in seconds. You'll need an API key from your dashboard.

bash
curl -X POST https://airquote.io/api/v1/search \
  -H "Authorization: Bearer aq_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"query": "the meaning of life"}'

Authentication

All API requests require authentication. You can authenticate using either method:

Bearer Token

http
Authorization: Bearer aq_your_api_key

API Key Header

http
X-API-Key: aq_your_api_key

Enhance

POST /api/v1/enhance

Get AI-enhanced contextual quote recommendations powered by Claude. Enhanced requests cost additional credits based on the number of quotes returned and context complexity.

Request Body

json
{
  "query": "a quote about perseverance for a graduation speech",
  "context": "The audience is new college graduates entering the workforce.",
  "count": 3,
  "format": "chicago"
}

Response

json
{
  "quotes": [
    {
      "id": "qt_abc123",
      "text": "Ever tried. Ever failed. No matter. Try again. Fail again. Fail better.",
      "author": "Samuel Beckett",
      "source": "Worstward Ho",
      "verified": true,
      "relevance_note": "Speaks directly to the iterative nature of early-career growth.",
      "citation": "Beckett, Samuel. Worstward Ho. New York: Grove Press, 1983."
    }
  ],
  "meta": {
    "credits_used": 3,
    "credits_remaining": 17,
    "model": "claude-sonnet"
  }
}

Credit Calculation

Base cost: 1 credit. Each additional quote requested adds 1 credit. Using the context field adds 1 credit. For example, requesting 3 quotes with context costs 5 credits (1 base + 3 quotes + 1 context).

Random

GET /api/v1/random

Returns a random verified quote. Optionally filter by category or author.

bash
curl "https://airquote.io/api/v1/random?category=philosophy" \
  -H "Authorization: Bearer aq_your_api_key"

Query Parameters

ParameterTypeDescription
categorystringFilter by category
authorstringFilter by author name
formatstringCitation format (mla, apa, chicago, ap, simple)

Response

json
{
  "quote": {
    "id": "qt_xyz789",
    "text": "The unexamined life is not worth living.",
    "author": "Socrates",
    "source": "Apology (Plato)",
    "verified": true
  },
  "meta": {
    "credits_used": 1,
    "credits_remaining": 18
  }
}

Quote of the Day

GET /api/v1/quote-of-day

Returns the quote of the day. This endpoint does not require authentication and does not consume credits. The response is cached and rotates daily at midnight UTC.

bash
curl https://airquote.io/api/v1/quote-of-day

Response

json
{
  "quote": {
    "id": "qt_daily001",
    "text": "In the middle of difficulty lies opportunity.",
    "author": "Albert Einstein",
    "source": "Letter to a friend, 1940s",
    "verified": true
  },
  "date": "2026-03-06"
}

Rate Limits

Rate limits vary by plan. When you exceed your rate limit, the API returns a 429 Too Many Requests status code.

PlanRequests/minRequests/day
Free102,000
Starter3010,000
Pro100100,000

Rate Limit Headers

All API responses include the following headers:

HeaderDescription
X-RateLimit-LimitMaximum requests per window
X-RateLimit-RemainingRequests remaining in current window
X-RateLimit-ResetUnix timestamp when the window resets

Error Codes

StatusCodeDescription
401invalid_api_keyThe API key is missing or invalid.
402insufficient_creditsYour account has no remaining credits. Upgrade your plan or wait for credits to reset.
429rate_limitedYou have exceeded your rate limit. Wait and retry.
500server_errorAn unexpected error occurred on the server.

Error Response Format

json
{
  "error": {
    "code": "insufficient_credits",
    "message": "You have 0 credits remaining. Please upgrade your plan.",
    "status": 402
  }
}

Citation Formats

Pass the format parameter to any endpoint to receive pre-formatted citations.

FormatExample
mlaBeckett, Samuel. "Worstward Ho." 1983.
apaBeckett, S. (1983). Worstward Ho.
chicagoBeckett, Samuel. Worstward Ho. New York: Grove Press, 1983.
apSamuel Beckett, "Worstward Ho," 1983.
simple-- Samuel Beckett, Worstward Ho (1983)