Skip to content

localscripts/voxlisAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

voxlisAPI

This is a small PHP endpoint that polls multiple version endpoints (e.g. Roblox client versions, custom services), and exposes a single JSON snapshot with:

  • Current version value per service (output)
  • Whether that service is updated vs Roblox baseline (desktop) or Roblox mobile policy
  • Optional live status per service
  • A WorkingVersions footer with the currently good versions per platform
  • Optional _errors + _diag blocks for debugging

It also supports:

  • Snapshot caching with a cooldown (e.g. 30 minutes)
  • History files for uptime / “minutes updated” tracking
  • Graceful fallback to previous snapshot if a fetch fails

Files

  • weao/config.php – configuration (services, cache, history, HTTP options, etc.)
  • testxd.php (or similar) – main endpoint that:
    • Reads weao/config.php
    • Polls services
    • Writes + serves snapshot.json
    • Maintains history files under cache/history

How it Works (High-level)

  1. Desktop baselines (Roblox)

    • It fetches reference versions for:
      • Windows: roblox_ref_urls['windows']
      • macOS: roblox_ref_urls['macos']
    • For each Windows/macOS service, it compares the service’s version(s) against that baseline.
    • If the service matches the baseline → updated: true.
  2. Mobile (Android / iOS)

    • It extracts a candidate version string from the service output.
    • It calls Roblox’s mobile-client-version API with:
      • AppAndroidV<version> for Android
      • AppiOSV<version> for iOS
    • If Roblox responds with UpgradeAction of none, notrequired, or recommendedupdated: true.
  3. Snapshot cache

    • Latest response is written to a JSON file (e.g. cache/snapshot.json).
    • On each request:
      • If snapshot is fresh (ttl not expired) and no ?refresh=1, it returns the cached JSON directly.
      • Otherwise, it re-fetches services, rebuilds the snapshot, returns it, and overwrites the cache.
  4. History / uptime

    • For each (platform, service, version) it keeps a JSON history file under cache/history.
    • Every run, it:
      • Tracks a __lastTick timestamp.
      • Increments that version’s counter by elapsed minutes only if updated === true.
    • This gives you “how many minutes this version has been in an updated state”.

Configuration (weao/config.php)

Basic example:

<?php
declare(strict_types=1);

/** Config with 30-min snapshot cooldown + history (uptime) */
return [
    'default_user_agent' => 'Mozilla/5.0 (...) VersionFetcher/1.9',

    'http' => [
        'timeout' => 12,
        'headers' => [
            'Accept: application/json, text/plain, */*',
            'Pragma: no-cache',
            'Cache-Control: no-cache',
        ],
    ],

    'response_headers' => [
        'Content-Type'  => 'application/json; charset=utf-8',
        'Cache-Control' => 'no-store, no-cache, must-revalidate',
    ],

    'snapshot_cache' => [
        'enabled'       => true,
        'dir'           => __DIR__ . '/cache',
        'filename'      => 'snapshot.json',
        'ttl'           => 1800,          // seconds (e.g. 1800 = 30 minutes)
        'refresh_param' => 'refresh',     // ?refresh=1 to bypass cache
    ],

    'history' => [
        'enabled'              => true,
        'dir'                  => __DIR__ . '/cache/history',
        'max_entries'          => 10,
        'wrap_key_with_service'=> true,
    ],

    'output_key' => 'output',

    'roblox_ref_urls' => [
        'windows' => 'https://clientsettingscdn.roblox.com/v2/client-version/WindowsPlayer',
        'macos'   => 'https://clientsettingscdn.roblox.com/v2/client-version/MacPlayer',
    ],

    'services' => [
        'windows' => [
            'aimmy' => [
                'url'   => 'https://clientsettingscdn.roblox.com/v2/client-version/WindowsPlayer/channel/LIVE',
                'field' => 'clientVersionUpload',
                // optional:
                // 'live_field'  => 'status.live',
                // 'live_truthy' => ['up','online'],
                // 'live_falsy'  => ['down','offline'],
                // 'beta_after_roblox' => true,
            ],
        ],
        'macos' => [
            // ...
        ],
        'android' => [
            'vegax' => [
                'url'   => 'https://gitlab.com/marsqq/vegax4/-/raw/main/version',
                'field' => null, // whole body
            ],
        ],
        'ios' => [
            'arceusx' => [
                'url'   => 'https://raw.githubusercontent.com/.../ios.txt',
                'field' => null,
            ],
        ],
    ],
];

Key config fields

  • default_user_agent – UA string used in outbound HTTP requests (overridden by ?ua=).

  • http.timeout – cURL timeout (seconds).

  • http.headers – extra headers for all outbound requests (format: "Header: value" strings).

  • response_headers – headers added to every response (unless already sent).

  • snapshot_cache.enabled – enable snapshot caching.

  • snapshot_cache.dir – directory for snapshot file.

  • snapshot_cache.filename – snapshot filename (JSON).

  • snapshot_cache.ttl – snapshot Time-To-Live in seconds.

  • snapshot_cache.refresh_param – query parameter name to force rebuild (?refresh=1).

  • history.enabled – enable uptime history.

  • history.dir – directory for per-service history JSON files.

  • history.max_entries – max version keys stored per history file.

  • history.wrap_key_with_service – if true, history JSON is nested under the service name.

  • output_key – key used for the raw value in the output JSON (default: output).

  • roblox_ref_urls – baseline endpoints for desktop Roblox clients.

  • services – service definitions, grouped by platform: windows, macos, android, ios.

Each service entry supports:

  • url (required) – endpoint to fetch.

  • field (nullable) – JSON dot-path to extract the version value:

    • null → use whole body (or whole JSON).
    • e.g. "clientVersionUpload" or "data.0.version".
  • live_field (optional) – JSON dot-path to read a live/up/down flag.

  • live_truthy, live_falsy (optional) – arrays of strings treated as true/false.

  • beta_after_roblox (optional, desktop only, true/false):

    • Special behavior described below.

Special: beta_after_roblox mode

For desktop services with 'beta_after_roblox' => true:

  • The script stores the Roblox baseline for that platform in _baseline.

  • When Roblox baseline changes:

    • The service is not immediately marked updated.
    • It only becomes updated: true once its own output changes for that new baseline.
  • This lets you track “beta” clients that should update after Roblox bumps.

live === false always forces updated = false before history increments.


API Usage

Assume your script is deployed as https://your.domain/testxd.php.

Basic call

GET /testxd.php

Returns latest snapshot (from cache if fresh), as JSON.

Query parameters

  • refresh=1 Force a rebuild, ignoring cached snapshot TTL.

  • errors=1 Include internal _errors array in the response.

  • diag=1 Include _diag object with diagnostics:

    "_diag": {
      "php_version": "8.3.0",
      "curl_loaded": true,
      "snapshot_dir": "/path/to/weao/cache",
      "history_dir": "/path/to/weao/cache/history"
    }
  • platform=windows|macos|android|ios Only fetch and return services for that platform.

  • service=<serviceName> When combined with platform, restricts to a single service.

    Example:

    GET /testxd.php?platform=windows&service=aimmy
  • ua=<string> Override the outbound HTTP User-Agent for this request only.


Response Format

Example minimal response shape (without _errors / _diag):

{
  "windows": {
    "aimmy": {
      "updated": true,
      "output": "version-12345",
      "_baseline": "version-12345",
      "live": true
    }
  },
  "android": {
    "vegax": {
      "updated": false,
      "output": "2.3.4",
      "live": true
    }
  },
  "ios": {
    "arceusx": {
      "updated": true,
      "output": "5.6.7"
    }
  },
  "WorkingVersions": {
    "windows": "version-12345",
    "macos": "version-67890",
    "ios": ["5.6.7"],
    "android": ["2.3.4"]
  }
}

Fields

  • <platform>.<service>.updated (bool)

    • Desktop: true if service version matches Roblox baseline.
    • Mobile: true if Roblox mobile API says update is not required.
    • If fetch fails, previous updated value from snapshot is reused.
  • <platform>.<service>.<output_key> (string) The raw value extracted from the service response.

  • <platform>.<service>.live (bool, optional) Only present when:

    • live_field is configured, and
    • Its value could be interpreted as true/false.
    • If fetch fails and we had a previous live, that previous value is reused.
  • <platform>.<service>._baseline (string, desktop only, optional) The Roblox baseline value for that platform (mainly for beta_after_roblox logic).

  • WorkingVersions.windows / WorkingVersions.macos Roblox desktop baseline versions.

  • WorkingVersions.ios / WorkingVersions.android Arrays of mobile versions that are currently considered “OK” (not requiring upgrade).

  • _errors (optional, only if errors=1) Array of internal error objects:

    {
      "_errors": [
        {
          "kind": "http",
          "message": "status 500",
          "context": { "url": "https://..." }
        }
      ]
    }

CORS

The script is CORS-friendly:

  • Sends Access-Control-Allow-Origin for whitelisted origins:

    $CORS_ALLOWED_ORIGINS = ['https://voxlis.net','https://www.voxlis.net'];
  • Handles OPTIONS preflight requests and sets:

    • Access-Control-Allow-Methods
    • Access-Control-Allow-Headers
    • Access-Control-Max-Age
  • You can change the arrays at the top of WEAO::run().


Error Handling & Fallbacks

  • If a service fetch fails (HTTP error, timeout, invalid JSON, etc.):

    • The script keeps previous snapshot values for:

      • output
      • updated
      • live
    • It records an entry in _errors (visible only when ?errors=1).

  • On fatal errors (parse error, etc.), it tries to return:

    {
      "_fatal": "error message here"
    }

    with JSON headers and CORS still set.


Requirements

  • PHP 7.4+ (works fine on PHP 8+)

  • curl extension enabled

  • Read/write access to:

    • cache/ (snapshot JSON)
    • cache/history/ (history JSON files)

About

Source code of voxlis.NET backend

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages