APIv1checking…

ScriptBlock Developer Docs

Everything you need to build with the ScriptBlock platform — public endpoints, live stats, ranked search, and scoped API keys.

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

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
ParamTypeDescription
pagenumberPage number (default 1)
sortBystringcreated_at, views, likes
orderstringasc | desc
modestringfree | paid filter
universalbool1 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
    }
  ]
}
FieldDescription
nameExecutor name
platformwindows, android, macos, ios, multi
typefree | key | paid
websiteOfficial site
patched1 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
  }
}

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.

MethodEndpointNotes
POST/api/auth/loginCredentials → JWT
POST/api/auth/registerCreate account
POST/api/auth/logoutInvalidate token
GET/api/auth/meCurrent 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 typeLimit
Anonymous60 req/min per IP
API key300 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.

CodeMeaning
200Success
400Invalid request / missing params
401Not authenticated
403Forbidden / invalid API key
404Not found
429Rate limited
500Server error

Error bodies follow { "error": "message", "code": "..." }.