Overview

The PandaBlox API allows you to programmatically access scripts, games, and other platform data in JSON format. All responses are JSON-encoded and use standard HTTP response codes.

Base URL

https://pandablox.com/api

Rate Limits

  • General API: 100 requests per 15 minutes
  • Search API: 20 requests per minute
  • Upload API: 10 requests per hour (authenticated users)

Content Type

All requests should include the following header:

Content-Type: application/json

Authentication

Login

POST /auth/login

Request Body

{
  "username": "your_username",
  "password": "your_password"
}

Response (200 OK)

{
  "message": "Login successful",
  "user": {
    "id": "clxxx...",
    "username": "your_username",
    "email": "[email protected]",
    "role": "USER",
    "verified": false,
    "avatarUrl": null,
    "bio": null
  },
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refreshToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}

Using Access Tokens

Include the access token in the Authorization header for protected endpoints:

Authorization: Bearer YOUR_ACCESS_TOKEN

Refresh Token

POST /auth/refresh

Request Body

{
  "refreshToken": "your_refresh_token"
}

Response (200 OK)

{
  "accessToken": "new_access_token",
  "refreshToken": "new_refresh_token"
}

Scripts

Important: You can get the entire content of any script in JSON format using the endpoints below. This allows you to parse and integrate scripts into your own applications.

Get All Scripts

GET /scripts

Query Parameters

  • page - Page number (default: 1)
  • limit - Results per page (default: 20, max: 100)
  • search - Search query
  • game - Filter by game slug
  • tag - Filter by tag slug
  • verified - Filter verified scripts (true/false)
  • sort - Sort order (recent, popular, trending)

Example Request

GET /api/scripts?verified=true&limit=10&sort=popular

Response (200 OK)

{
  "scripts": [
    {
      "id": "clxxx...",
      "title": "Infinite Jump Script",
      "slug": "infinite-jump-script",
      "description": "Allows infinite jumping in any game",
      "thumbnailUrl": "/uploads/thumbnails/xxx.png",
      "views": 15234,
      "downloads": 8932,
      "likeCount": 1203,
      "isVerified": true,
      "isMobile": true,
      "hasKeySystem": false,
      "createdAt": "2025-01-15T10:30:00.000Z",
      "author": {
        "username": "scriptdev",
        "verified": true,
        "avatarUrl": "/uploads/avatars/xxx.png"
      },
      "game": {
        "name": "Universal",
        "slug": "universal"
      },
      "tags": [
        {
          "tag": {
            "name": "Parkour",
            "slug": "parkour",
            "color": "#667eea"
          }
        }
      ]
    }
  ],
  "pagination": {
    "currentPage": 1,
    "totalPages": 45,
    "totalScripts": 892,
    "hasNext": true,
    "hasPrev": false
  }
}

Get Script Details (JSON)

GET /scripts/:slug

This endpoint returns the complete script information including the full code content in JSON format.

Example Request

GET /api/scripts/infinite-jump-script

Response (200 OK)

{
  "id": "clxxx...",
  "title": "Infinite Jump Script",
  "slug": "infinite-jump-script",
  "description": "Allows infinite jumping in any game",
  "code": "-- Infinite Jump Script\nlocal player = game.Players.LocalPlayer\n...",
  "thumbnailUrl": "/uploads/thumbnails/xxx.png",
  "views": 15234,
  "downloads": 8932,
  "likeCount": 1203,
  "dislikeCount": 45,
  "isVerified": true,
  "isPublic": true,
  "isMobile": true,
  "hasKeySystem": false,
  "keyLink": null,
  "isPaid": false,
  "price": null,
  "createdAt": "2025-01-15T10:30:00.000Z",
  "updatedAt": "2025-01-20T14:22:00.000Z",
  "author": {
    "id": "clxxx...",
    "username": "scriptdev",
    "verified": true,
    "avatarUrl": "/uploads/avatars/xxx.png",
    "bio": "Professional script developer"
  },
  "game": {
    "id": "clxxx...",
    "name": "Universal",
    "slug": "universal",
    "thumbnailUrl": null
  },
  "tags": [
    {
      "tag": {
        "id": "clxxx...",
        "name": "Parkour",
        "slug": "parkour",
        "color": "#667eea"
      }
    }
  ]
}

Usage Example (JavaScript)

// Fetch script data
const response = await fetch('https://pandablox.com/api/scripts/infinite-jump-script');
const scriptData = await response.json();

// Extract the code
const luaCode = scriptData.code;

// Parse script metadata
console.log('Title:', scriptData.title);
console.log('Author:', scriptData.author.username);
console.log('Verified:', scriptData.isVerified);
console.log('Code length:', luaCode.length);

Get Raw Script Code

GET /scripts/:slug/raw

Returns the raw Lua script code as plain text (not JSON).

Example Request

GET /api/scripts/infinite-jump-script/raw

Response (200 OK)

Content-Type: text/plain

-- Infinite Jump Script
local player = game.Players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

humanoid.JumpPower = 100
...

Usage Example (cURL)

curl https://pandablox.com/api/scripts/infinite-jump-script/raw

Create Script (Authenticated)

POST /scripts Requires Authentication

Headers

Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json

Request Body

{
  "title": "My Awesome Script",
  "description": "This script does amazing things",
  "code": "-- Lua code here\nprint('Hello World')",
  "gameId": "clxxx...",
  "tags": ["clxxx...", "clyyy..."],
  "isMobile": true,
  "hasKeySystem": false,
  "isPublic": true,
  "thumbnail": "data:image/png;base64,..."
}

Response (201 Created)

{
  "message": "Script uploaded successfully",
  "script": {
    "id": "clxxx...",
    "title": "My Awesome Script",
    "slug": "my-awesome-script",
    ...
  }
}

Update Script (Authenticated)

PUT /scripts/:slug Requires Authentication

Update your own script. Only the script author can update it.

Request Body (all fields optional)

{
  "title": "Updated Title",
  "description": "Updated description",
  "code": "-- Updated code",
  "gameId": "clxxx...",
  "tags": ["clxxx..."],
  "isMobile": true,
  "hasKeySystem": false,
  "isPublic": true,
  "thumbnail": "data:image/png;base64,..."
}

Delete Script (Authenticated)

DELETE /scripts/:slug Requires Authentication

Delete your own script. Only the script author can delete it.

Response (200 OK)

{
  "message": "Script deleted successfully"
}

Like Script (Authenticated)

POST /scripts/:slug/like Requires Authentication

Request Body

{
  "type": "like"
}

Response (200 OK)

{
  "message": "Script liked successfully",
  "likeCount": 1204,
  "dislikeCount": 45
}

Games

Get All Games

GET /games

Response (200 OK)

[
  {
    "id": "clxxx...",
    "name": "Blox Fruits",
    "slug": "blox-fruits",
    "thumbnailUrl": "/uploads/games/blox-fruits.png",
    "_count": {
      "scripts": 342
    }
  },
  {
    "id": "clyyy...",
    "name": "Adopt Me",
    "slug": "adopt-me",
    "thumbnailUrl": "/uploads/games/adopt-me.png",
    "_count": {
      "scripts": 218
    }
  }
]

Tags

Get All Tags

GET /tags

Returns the top 50 tags sorted by usage count.

Response (200 OK)

[
  {
    "id": "clxxx...",
    "name": "Roleplay",
    "slug": "roleplay",
    "color": "#667eea",
    "usageCount": 156
  },
  {
    "id": "clyyy...",
    "name": "Simulator",
    "slug": "simulator",
    "color": "#f093fb",
    "usageCount": 142
  }
]

Statistics

Get Platform Stats

GET /stats

Response (200 OK)

{
  "totalScripts": 892,
  "totalUsers": 5432,
  "totalViews": 1234567,
  "totalDownloads": 987654
}

Error Handling

HTTP Status Codes

  • 200 OK - Request successful
  • 201 Created - Resource created successfully
  • 400 Bad Request - Invalid request parameters
  • 401 Unauthorized - Authentication required or failed
  • 403 Forbidden - Insufficient permissions
  • 404 Not Found - Resource not found
  • 429 Too Many Requests - Rate limit exceeded
  • 500 Internal Server Error - Server error

Error Response Format

{
  "error": "Error Type",
  "message": "Detailed error message"
}

Example Error Responses

401 Unauthorized

{
  "error": "Unauthorized",
  "message": "Invalid or expired access token"
}

404 Not Found

{
  "error": "Not Found",
  "message": "Script not found"
}

429 Too Many Requests

{
  "error": "Too Many Requests",
  "message": "Rate limit exceeded. Please try again later."
}