Skip to main content

Space Frontiers API Documentation

One REST API over 2.8B charted documents — scholarly publications, books, patents, encyclopedias, and public discussion. Search, fetch full texts, download available originals by ID or canonical URI, cite sources, and recognize your own PDF, EPUB, and DJVU files into structured Markdown.

API Features

Token-Bounded Full Text

Return complete document text by default, or request the exact first N tokens with predictable token-based pricing.

Original Downloads

Stream available PDF, EPUB, and DJVU originals by document ID or canonical URI, with byte-range support and no whole-file proxy buffering.

Semantic Search

Search across millions of documents using natural language queries with AI-powered semantic understanding.

Multi-Source Access

Query scholarly articles, Wikipedia, Telegram, Reddit, YouTube, and more from a single unified API.

Document Recognition

Upload PDF, EPUB, or DJVU files and get clean structured Markdown with a per-document quality report.

Simple Authentication

Secure API key-based authentication with usage tracking and flexible pricing tiers.

Quick Start

  1. Get an API key from the API Keys page.
  2. Use the base URL https://api.spacefrontiers.org.
  3. Include your API key in the X-Api-Key header.

Example: Search Request

curl -X POST https://api.spacefrontiers.org/v2/search/ \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "machine learning transformers",
    "limit": 10
  }'

Example: Fetch Text or Download the Original

Limit a text response by tokens, or stream the original by document ID or a percent-encoded canonical URI. Raw document downloads are available to eligible accounts. See current API pricing and access terms.

# Current pricing and access terms: https://spacefrontiers.org/pricing
# Return exactly the first 4,096 text tokens
curl -H "X-Api-Key: YOUR_API_KEY" \
  "https://api.spacefrontiers.org/v2/documents/31tlqhmn2jmoh3gzlea74trb3?max_tokens=4096"

# Stream a PDF original by document ID
curl -L -H "X-Api-Key: YOUR_API_KEY" \
  -o document.pdf \
  "https://api.spacefrontiers.org/v2/downloads/31tlqhmn2jmoh3gzlea74trb3.pdf"

# Or resolve the original from a percent-encoded canonical URI
curl -L -H "X-Api-Key: YOUR_API_KEY" \
  -o document.pdf \
  "https://api.spacefrontiers.org/v2/downloads/by-uri/doi%3A%2F%2F10.1016%2Fj.neulet.2008.10.099?format=pdf"

Example: Recognize a PDF

Upload a document, then poll the job and fetch the recognized Markdown:

# Submit (billed per document, see /pricing; identical resubmissions are free)
curl -X POST https://api.spacefrontiers.org/v1/recognitions \
  -H "X-Api-Key: YOUR_API_KEY" \
  -F "[email protected]"
# => {"id": "<job_id>", "status": "pending"}

# Poll until completed, then fetch the Markdown and the quality report
curl -H "X-Api-Key: YOUR_API_KEY" \
  https://api.spacefrontiers.org/v1/recognitions/<job_id>/result

Python Client Library

Use our official Python client for easier integration:

pip install spacefrontiers-clients
from spacefrontiers.clients import SearchApiClient

async with SearchApiClient(api_key="YOUR_API_KEY") as client:
    response = await client.search_v2(
        query="machine learning transformers",
        limit=10,
        mode="hybrid",
    )

For complete API documentation, see the interactive API reference or fetch the OpenAPI spec.

Common Use Cases

Research & Academia

Build literature review tools, citation networks, and research discovery platforms with access to millions of scholarly papers.

OSINT & Monitoring

Monitor social media trends, track mentions, and gather intelligence from Telegram and Reddit communities.

AI Applications

Integrate real-time data retrieval into your AI agents, chatbots, and LLM-powered applications via our MCP server.

Data Analysis

Extract structured data, perform sentiment analysis, and build custom analytics pipelines with our search API.

Start Building with Space Frontiers API

Get your API key and start integrating powerful search capabilities into your applications today.