API Overview

PixelRAG indexes 8.28M Wikipedia articles as screenshot tiles and retrieves over the images directly. Using the API is a two-step flow: search for the tiles that match your query, then fetch each tile's screenshot.

Example

Search, then fetch the top hit's screenshot:

# 1 — search with a text query
curl -X POST https://pixelrag.ai/api/search \
  -H "Content-Type: application/json" \
  -d '{"queries": [{"text": "How does photosynthesis work?"}], "n_docs": 5}'

# → hits[0] = { "article_id": 5878188, "tile_index": 1, "chunk_index": 0, ... }

# 2 — fetch that hit's screenshot
curl https://pixelrag.ai/api/tile/5878188/1/0 --output tile.png

# 3 — or search with an image: base64-encode any local file inline
curl -X POST https://pixelrag.ai/api/search \
  -H "Content-Type: application/json" \
  -d "{\"queries\": [{\"image\": \"$(base64 < photo.jpg | tr -d '\n')\"}], \"n_docs\": 5}"

# 4 — hybrid: combine text + image in one query (joint multimodal retrieval)
curl -X POST https://pixelrag.ai/api/search \
  -H "Content-Type: application/json" \
  -d "{\"queries\": [{\"text\": \"impressionist oil painting\", \"image\": \"$(base64 < photo.jpg | tr -d '\n')\"}], \"n_docs\": 5}"

Base URL

https://pixelrag.ai/api — or query the index server directly at https://api.pixelrag.ai.

Endpoints

Connect your own agent

The search API is a plain HTTP endpoint — wire it into any agent framework (Claude tool-use, OpenAI function calling, LangChain, custom harness) as a tool. A typical agent loop: search with text and/or an image, fetch tiles to read the screenshots, then answer from what they show.

# Text-only search
curl -X POST https://pixelrag.ai/api/search \
  -H "Content-Type: application/json" \
  -d '{"queries": [{"text": "When was the Eiffel Tower built?"}], "n_docs": 5}'

# Image-only search (visual similarity)
curl -X POST https://pixelrag.ai/api/search \
  -H "Content-Type: application/json" \
  -d "{\"queries\": [{\"image\": \"$(base64 < photo.jpg | tr -d '\n')\"}], \"n_docs\": 5}"

# Joint image + text search (best for "what is this X?")
curl -X POST https://pixelrag.ai/api/search \
  -H "Content-Type: application/json" \
  -d "{\"queries\": [{\"image\": \"$(base64 < photo.jpg | tr -d '\n')\", \"text\": \"landmark building\"}], \"n_docs\": 5}"

# Fetch a tile screenshot from the results
curl https://pixelrag.ai/api/tile/698618/0/0 --output tile.png