Developers
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." }
| HTTP | kind | meaning |
|---|---|---|
| 400 | validation, guard, sql | Invalid input, rejected SQL or execution error |
| 401 | auth | Missing/invalid key or session |
| 403 | tier, csrf, forbidden | Not included in your tier, or not allowed |
| 404 | not_found | Unknown resource |
| 408 | timeout | Query exceeded its time limit |
| 422 | validation, unsupported_question | Schema error, or question not supported by the template engine |
| 429 | quota | Daily quota or per-minute rate limit reached |
| 503 | busy, maintenance | Query 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
| Method | Path | Description |
|---|---|---|
| GET | /status | Service health, freshness, coverage |
| GET | /stats | Headline statistics |
| GET | /schema | Data dictionary |
| GET | /feed | Latest trades |
| GET | /market?range=24h | Market summary for 5m/1h/24h/7d/30d |
| GET | /tokens | Token list with filters and sorting |
| GET | /tokens/{mint} | Token profile |
| GET | /tokens/{mint}/trades | Trades, newest first (paginate with cursor = previous meta.next_cursor) |
| GET | /tokens/{mint}/candles | OHLCV candles |
| GET | /tokens/{mint}/risk | Risk signals |
| GET | /tokens/{mint}/block0 | Launch-slot activity |
| GET | /wallets/{address} | Wallet positions and PnL |
| GET | /developers/{address} | Creator profile |
| POST | /query | Run SQL |
| POST | /ask | Natural-language question |
| POST | /backtest | Run a backtest |
| GET | /models | Models 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();