WikiRest Docs

Authentication

Learn how to authenticate your API requests and manage your API keys.

API Keys

All API requests require authentication using an API key. You can create and manage API keys from your dashboard.

Key format

API keys are 32-character strings with a wk_ prefix:

wk_a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6

Sending your API key

Include your API key in the X-API-Key header with every request:

curl -H "X-API-Key: wk_your_api_key_here" \
  "https://api.wikirest.com/v1/search?q=test"

Alternative: Bearer token

You can also use the standard Authorization header with Bearer scheme:

curl -H "Authorization: Bearer wk_your_api_key_here" \
  "https://api.wikirest.com/v1/search?q=test"

Managing API keys

Creating keys

You can create multiple API keys for different purposes (development, production, different applications). Each key can have:

  • Name: A descriptive label (e.g., "Production API", "Dev Testing")
  • Scopes: Permissions (read-only or full access)
  • Expiration: Optional expiry date

Key security best practices

  • Never expose API keys in client-side code or public repositories
  • Use environment variables to store keys
  • Rotate keys periodically
  • Use separate keys for development and production
  • Revoke unused keys immediately

Revoking keys

If a key is compromised, revoke it immediately from your dashboard. Revoked keys stop working instantly. You can create a new key to replace it.

Authentication errors

401 Unauthorized

Returned when no API key is provided:

{
  "error": "unauthorized",
  "message": "API key required. Include X-API-Key header."
}

403 Forbidden

Returned when the API key is invalid or revoked:

{
  "error": "forbidden",
  "message": "Invalid or revoked API key."
}

Limits by Plan

All API limits are adjustable based on your subscription plan. Each API key inherits the limits from your account's plan.

Plan Rate Limit Monthly Quota Keys Allowed
Free 10/sec 5,000/mo 3
Starter 25/sec 50,000/mo 5
Growth 50/sec 250,000/mo 10
Business 100/sec 1,000,000/mo 20
Enterprise Custom Unlimited Unlimited

See Rate Limiting and Monthly Quotas for details. View all plans →

Code examples

Python

import requests
import os

API_KEY = os.environ.get("WIKIREST_API_KEY")

response = requests.get(
    "https://api.wikirest.com/v1/search",
    headers={"X-API-Key": API_KEY},
    params={"q": "machine learning"}
)
data = response.json()

JavaScript (Node.js)

const API_KEY = process.env.WIKIREST_API_KEY;

const response = await fetch(
  "https://api.wikirest.com/v1/search?q=machine+learning",
  { headers: { "X-API-Key": API_KEY } }
);
const data = await response.json();

Go

package main

import (
	"net/http"
	"os"
)

func main() {
	apiKey := os.Getenv("WIKIREST_API_KEY")

	req, _ := http.NewRequest("GET", "https://api.wikirest.com/v1/search?q=test", nil)
	req.Header.Set("X-API-Key", apiKey)

	client := &http.Client{}
	resp, _ := client.Do(req)
	defer resp.Body.Close()
}

Was this page helpful?

Help us improve our documentation