Ox Ox API Documentation

Base URL: https://ox.aikode.org/fetch.php

Ox extracts main content from any URL and returns clean GitHub Flavored Markdown. Save 27-60% tokens vs raw HTML.

Authentication

All requests require an API key passed via HTTP header:

X-Ox-Key: YOUR_API_KEY
Important: Never include your API key in URL parameters. Always use the HTTP header.

Quick Start

cURL

curl -H "X-Ox-Key: YOUR_API_KEY" \
  "https://ox.aikode.org/fetch.php?url=https://example.com"

Python

import requests

headers = {'X-Ox-Key': 'YOUR_API_KEY'}
params = {'url': 'https://example.com'}

response = requests.get(
    'https://ox.aikode.org/fetch.php',
    headers=headers,
    params=params
)

markdown = response.text
print(markdown)

JavaScript

const response = await fetch(
  'https://ox.aikode.org/fetch.php?url=https://example.com',
  {
    headers: {
      'X-Ox-Key': 'YOUR_API_KEY'
    }
  }
);

const markdown = await response.text();
console.log(markdown);

Parameters

Parameter Required Description
url Yes The URL to fetch and convert. Must be URL-encoded.
URL Encoding: Always encode the URL parameter. For example:
?url=https%3A%2F%2Fexample.com%2Farticle%3Fid%3D123

Response Format

Returns plain text in GitHub Flavored Markdown format:

# Page Title

Main content starts here...

## Subheading

More content with [links](https://example.com) and **formatting**.

### Tables

| Column 1 | Column 2 |
|----------|----------|
| Data     | More     |

Response Headers

Header Description Example
X-Ox-Cache Cache status HIT or MISS
X-Ox-Title Extracted page title Example Article
X-Ox-Limit Your monthly limit 500
X-Ox-Used Requests used this month 42
X-Ox-Remaining Requests remaining 458
Cached requests don't count toward your limit! If you fetch the same URL within 1 hour, you'll get a cached response (X-Ox-Cache: HIT) and it won't use your quota.

Error Codes

Code Error Description
400 Bad Request Missing or invalid url parameter
401 Unauthorized Invalid or missing API key
429 Rate Limit Monthly limit reached
500 Server Error Pandoc conversion failed
502 Bad Gateway Failed to fetch target URL

Examples

Fetch Wikipedia Article

curl -H "X-Ox-Key: YOUR_API_KEY" \
  "https://ox.aikode.org/fetch.php?url=https://en.wikipedia.org/wiki/Rust_(programming_language)"

# Returns:
# Rust (programming language)
# 
# **Rust** is a general-purpose programming language...
# (Note: Infobox table is automatically removed)

Check Usage Headers

curl -I -H "X-Ox-Key: YOUR_API_KEY" \
  "https://ox.aikode.org/fetch.php?url=https://example.com"

# Response includes:
# X-Ox-Cache: MISS
# X-Ox-Limit: 500
# X-Ox-Used: 43
# X-Ox-Remaining: 457

Rate Limits

Beta Plan: 500 requests/month

Best Practices

When to Use Ox

When NOT to Use Ox

Optimization Tips

Token Efficiency

Method Est. Tokens Savings
Raw HTML ~120,000 baseline
Readability HTML ~80,000 33%
Ox Markdown ~58,000 52%

Based on Wikipedia article testing. Savings vary by site.

Need Help?

Questions or issues? We're here to help:


Ox stores data in SET Files format | Learn more
© 2026 aikode.org