API Reference

DeepLedger REST API — search and cross-reference 8.5M+ public records programmatically.

Base URLhttps://deepfiles-api.deepfiles.workers.dev

Authentication

Include your API key in the Authorization header. API keys are available on the Pro and Enterprise plans.

curl -H "Authorization: Bearer df_live_YOUR_KEY" \
  https://deepfiles-api.deepfiles.workers.dev/v1/search?q=example

Endpoints

GET
/v1/search

Search across all datasets. Returns matching entities, documents, and relationships.

Parameters

qstring
required
Search query
datasetstringFilter by dataset (ofac, offshore-leaks, faa, irs-990, epstein, fec)
typestringFilter by entity type (person, company, aircraft, nonprofit, document)
countrystringISO 3166-1 alpha-2 country code
limitintegerMax results (default: 20, max: 100)
offsetintegerPagination offset (default: 0)

Response

{
  "query": "Mossack Fonseca",
  "dataset": "all",
  "total": 23,
  "offset": 0,
  "limit": 20,
  "results": [
    {
      "type": "entity",
      "id": "icij-12345",
      "title": "Mossack Fonseca & Co.",
      "snippet": "<mark>Mossack</mark> <mark>Fonseca</mark> & Co. (Panama)",
      "dataset": "offshore-leaks",
      "entity_type": "company"
    },
    {
      "type": "entity",
      "id": "ofac-67890",
      "title": "Mossack Fonseca Related Entity",
      "snippet": "OFAC designated entity linked to <mark>Mossack</mark>...",
      "dataset": "ofac",
      "entity_type": "company"
    }
  ]
}
GET
/v1/stats

Get aggregate statistics for all indexed datasets.

Response

{
  "total_records": 12500000,
  "datasets": 6,
  "entities": 8200000,
  "relationships": 3100000,
  "documents": 1200000,
  "shards": [
    {
      "dataset": "ofac",
      "entities": 350000,
      "relationships": 120000,
      "documents": 0
    }
  ],
  "last_updated": "2025-02-24T00:00:00Z"
}
GET
/v1/entity/:id

Get full details for a specific entity, including direct relationships.

Parameters

idstring
required
Entity ID (e.g., icij-12345, ofac-67890)

Response

{
  "entity": {
    "id": "icij-12345",
    "dataset_id": "offshore-leaks",
    "name": "Mossack Fonseca & Co.",
    "entity_type": "company",
    "metadata": {
      "countries": "Panama",
      "sourceID": "Panama Papers"
    },
    "created_at": "2026-02-25T00:00:00Z"
  },
  "relationships": [
    {
      "id": "icij-r-12345-67890",
      "source_entity_id": "icij-12345",
      "target_entity_id": "icij-67890",
      "relationship_type": "registered_agent",
      "dataset_id": "offshore-leaks",
      "connected_name": "John Doe",
      "connected_id": "icij-67890",
      "connected_type": "person"
    }
  ]
}
GET
/v1/entity/:id/connections

Multi-level graph traversal — follow entity relationships across datasets up to 3 levels deep. Find indirect connections between people, companies, and records.

Parameters

idstring
required
Root entity ID
depthintegerTraversal depth (default: 2, max: 3)

Response

{
  "root": "icij-12345",
  "depth": 2,
  "total_connections": 47,
  "connections": [
    {
      "from": "icij-12345",
      "to": "icij-67890",
      "name": "John Doe",
      "type": "person",
      "relationship": "shareholder",
      "dataset": "offshore-leaks",
      "depth": 1
    },
    {
      "from": "icij-67890",
      "to": "faa-N12345",
      "name": "Doe Aviation LLC",
      "type": "aircraft",
      "relationship": "registered_owner",
      "dataset": "faa",
      "depth": 2
    }
  ]
}
GET
/v1/document/:id

Get document content as markdown (default), JSON metadata, or original PDF.

Parameters

idstring
required
Document ID

Response

// With Accept: application/json
{
  "document": {
    "id": "epstein-EFTA00001234",
    "title": "Flight Log - February 2003",
    "dataset": "epstein",
    "source_filename": "EFTA00001234.pdf",
    "page_count": 12,
    "token_count": 4500,
    "has_pdf": true,
    "has_markdown": true
  }
}

// With Accept: text/markdown (default)
// Returns raw markdown content

// With Accept: application/pdf
// Returns original PDF binary

MCP Integration

DeepLedger is available as an MCP (Model Context Protocol) server for AI-native workflows. Connect it to Claude, Cursor, or any MCP-compatible client.

// claude_desktop_config.json
{
  "mcpServers": {
    "deepfiles": {
      "command": "npx",
      "args": ["-y", "@deepfiles/mcp-server"],
      "env": {
        "DEEPFILES_API_KEY": "df_live_YOUR_KEY"
      }
    }
  }
}

Available MCP Tools

searchFull-text search across all datasets
traverseMulti-level graph traversal — follow relationships up to 3 levels deep
get_entityGet entity details with direct relationships
get_documentGet document content as markdown or PDF
get_statsGet dataset statistics and record counts

Rate Limits

PlanRateQuota
Free10/day10 searches/day
Pro60/min1,000 per purchase
EnterpriseCustomUnlimited

Error Codes

CodeStatusDescription
400Bad RequestMissing or invalid query parameters
401UnauthorizedMissing or invalid API key
403ForbiddenInsufficient plan for this endpoint
404Not FoundEntity or document not found
429Too Many RequestsRate limit exceeded — retry after Retry-After header
500Internal ErrorUnexpected server error — please retry