Skip to content
DataLayer
Developers
On this page

REST API

Base URL: https://datalayer.fun/api/v1

The complete, always-current endpoint list is generated from the OpenAPI document: see the API page, the machine-readable openapi.json and the interactive reference at /api/v1/docs.

Authentication

Create a key in Settings (Holder tier and above), then send it with every request:

curl -s https://datalayer.fun/api/v1/tokens?limit=5 -H "x-api-key: dl_..."

Authorization: Bearer dl_... is also accepted. Keys are shown once and stored only as SHA-256 hashes; revoke them at any time. Public read endpoints also work without a key at anonymous limits.

Response format

Success:

{ "ok": true, "data": { "...": "..." }, "meta": { "built_at": "…", "watermark_ts": "…" } }

Error:

{ "ok": false, "kind": "guard", "error": "Table 'pg_catalog' is not available." }
HTTPkindmeaning
400validation, guard, sqlInvalid input, rejected SQL or execution error
401authMissing/invalid key or session
403tier, csrf, forbiddenNot included in your tier, or not allowed
404not_foundUnknown resource
408timeoutQuery exceeded its time limit
422validation, unsupported_questionSchema error, or question not supported by the template engine
429quotaDaily quota or per-minute rate limit reached
503busy, maintenanceQuery queue full, or maintenance mode

Rate limits

API keys are limited per minute by tier, and every SQL/AI call also counts against the daily quotas. Current values are published on the tiers page.

Core endpoints

MethodPathDescription
GET/statusService health, freshness, coverage
GET/statsHeadline statistics
GET/schemaData dictionary
GET/feedLatest trades
GET/market?range=24hMarket summary for 5m/1h/24h/7d/30d
GET/tokensToken list with filters and sorting
GET/tokens/{mint}Token profile
GET/tokens/{mint}/tradesTrades, newest first (paginate with cursor = previous meta.next_cursor)
GET/tokens/{mint}/candlesOHLCV candles
GET/tokens/{mint}/riskRisk signals
GET/tokens/{mint}/block0Launch-slot activity
GET/wallets/{address}Wallet positions and PnL
GET/developers/{address}Creator profile
POST/queryRun SQL
POST/askNatural-language question
POST/backtestRun a backtest
GET/modelsModels and readiness

Examples

Python:

import os, httpx
r = httpx.post("https://datalayer.fun/api/v1/query",
               headers={"x-api-key": os.environ["DATALAYER_API_KEY"]},
               json={"sql": "SELECT count(*) AS launches FROM tokens WHERE launch_ts >= now() - INTERVAL 1 HOUR"})
print(r.json()["data"]["rows"])

JavaScript:

const r = await fetch("https://datalayer.fun/api/v1/tokens?sort=volume&limit=10", {
  headers: { "x-api-key": process.env.DATALAYER_API_KEY },
});
const { data } = await r.json();