ScriptBlock API Docs
Build with the ScriptBlock platform. Read public script and executor data, query live platform stats, and authenticate with API keys for higher-rate access.
The ScriptBlock API is a real, production backend built on Cloudflare Workers + D1. Every endpoint below is live and served from https://scriptblock.pages.dev/api/*.
Base URL
https://scriptblock.pages.dev/api
Key features
- Public read endpoints — no key required for read access.
- Live status + platform analytics, updated in real time.
- Ranked search across scripts, users, games, and collections.
- Scoped API keys for authenticated, rate-aware usage.
Quick Start
Fetch the latest scripts with a single GET request:
# List approved scripts
curl "https://scriptblock.pages.dev/api/scripts?sortBy=created_at&order=desc"
# Live platform stats
curl "https://scriptblock.pages.dev/api/stats"
# Search the library
curl "https://scriptblock.pages.dev/api/search?q=blox&type=scripts"
That's it. All responses are JSON. Read the API Keys section to learn about authenticated access.
Base URL
All API requests are made against a single origin. Append the resource path to the base URL.
https://scriptblock.pages.dev/api
The production route /api/* is proxied to the Workers backend. Mutation requests (POST/DELETE on private resources) require a reCAPTCHA token.
Status
Returns the current operational state of the platform and its services.
GET /api/status
GET /api/status
{
"overall": "operational",
"services": {
"api": "operational",
"database": "operational"
},
"servicesUp": 2,
"servicesTotal": 2,
"checkedAt": "2026-09-01T00:00:00.000Z"
}
GET /api/health
Lightweight liveness check with latency and database state.
GET /api/health
{ "status": "ok", "database": "operational", "latency_ms": 41 }
Scripts
Browse the public script library with pagination, filtering, and sorting.
GET /api/scripts
GET /api/scripts
| Param | Type | Description |
page | number | Page number (default 1) |
sortBy | string | created_at, views, likes |
order | string | asc | desc |
mode | string | free | paid filter |
universal | bool | 1 for universal scripts only |
curl "https://scriptblock.pages.dev/api/scripts?sortBy=views&order=desc&mode=free"
The response shape is { scripts: [...], totalPages, total }.
GET /api/scripts/featured
Returns pinned/featured scripts shown on the site banner.
GET /api/scripts/trending
Returns top scripts by engagement over the last 48 hours (falls back to all-time).
Executors
GET /api/executors
GET /api/executors
{
"executors": [
{
"id": "37f75376-3427-4eb0-a0f7-733bed8a18fd",
"name": "Arcana",
"platform": "windows",
"type": "free",
"version": "1.0",
"website": "https://arcana.gg",
"patched": 0,
"downloads": 0
}
]
}
| Field | Description |
name | Executor name |
platform | windows, android, macos, ios, multi |
type | free | key | paid |
website | Official site |
patched | 1 if currently detected/patched |
Stats
GET /api/stats
GET /api/stats
Public, real-time platform aggregates backed by D1.
{
"stats": {
"users": 14,
"scripts": 27,
"games": 8,
"collections": 1,
"follows": 1,
"copies": 12,
"likes": 4,
"comments": 3,
"executors": 25,
"total_views": 51988,
"total_downloads": 13,
"total_likes": 1999,
"today_users": 1,
"today_scripts": 0
}
}
Search
GET /api/search
GET /api/search
| Param | Description |
q | Search query (required) |
type | all, scripts, users, games, collections |
limit | Max results |
curl "https://scriptblock.pages.dev/api/search?q=blox&type=scripts"
curl "https://scriptblock.pages.dev/api/search?q=universal&type=all"
Script results are ranked by title, then tags, then description.
API Keys
Create scoped API keys from the Developer page. Keys unlock authenticated access and rate-aware usage on public read endpoints via the X-API-Key header.
Create a key
POST /api/keys
curl -X POST "https://scriptblock.pages.dev/api/keys" \
-H "Authorization: Bearer <JWT>" \
-d '{"name":"my-app"}'
# responds once with the full key: prefix.secret
Use a key
curl "https://scriptblock.pages.dev/api/stats" \
-H "X-API-Key: sbx_abc123.secretvalue"
List & revoke
GET /api/keys
DELETE /api/keys/:id
Note: The full key is shown once at creation and stored only as a hash. Keep it safe.
Authentication
Manage your ScriptBlock account session programmatically.
| Method | Endpoint | Notes |
| POST | /api/auth/login | Credentials → JWT |
| POST | /api/auth/register | Create account |
| POST | /api/auth/logout | Invalidate token |
| GET | /api/auth/me | Current user |
Authenticate with Authorization: Bearer <JWT>. Mutation requests require a valid reCAPTCHA token.
Rate Limits
Public endpoints are rate-limited per IP to protect the backend. Authenticated API-key requests receive a higher quota. Exceeding the limit returns HTTP 429 with a Retry-After header.
| Access type | Limit |
| Anonymous | 60 req/min per IP |
| API key | 300 req/min per key |
Tip: Batch reads and cache responses client-side to stay well under limits.
Errors
The API uses conventional HTTP status codes.
| Code | Meaning |
200 | Success |
400 | Invalid request / missing params |
401 | Not authenticated |
403 | Forbidden / invalid API key |
404 | Not found |
429 | Rate limited |
500 | Server error |
Error bodies follow { "error": "message", "code": "..." }.