public REST API reference
Public REST API for encoding, decoding, and compiling VisualSource scripts. All endpoints accept and return JSON unless noted otherwise.
https://retrostudio-visualsource.onrender.com
Encodes a decoded VisualSource script into the compact base93 format (deflate + base93). The output is ready to paste into RetroStudio.
| Field | Type | Required | Description |
|---|---|---|---|
text | string | required | Raw decoded VS script text. |
keep_original | boolean | optional | Wrap output with control chars. Defaults to true. |
Decodes a base93-encoded VisualSource script string into human-readable block format. Supports legacy and current versions.
| Field | Type | Required | Description |
|---|---|---|---|
text | string | required | Encoded VS script string. |
keep_original | boolean | optional | Preserve control-char separators. Defaults to true. |
Compiles a decoded VS script into Luau source code and returns it directly.
| Field | Type | Required | Description |
|---|---|---|---|
text | string | required | Decoded VS script text. |
parallelize_threshold | integer | optional | Loop blocks with more direct children than this run the extra children in task.spawn. Defaults to 0. |
wrap_in_pcall | boolean | optional | Wrap parallelized loop children and function bodies in pcall, logging errors via warn(). Defaults to false. |
strict_mode | boolean | optional | Adds --!strict to the top of the generated Luau. Defaults to false. |
minify | boolean | optional | Strip comments and compact indentation/blank lines. Defaults to false. |
use_task_delay_for_wait | boolean | optional | Wait blocks with children emit task.delay instead of task.wait followed by the children inline. Ignored if legacy_wait is on. Defaults to false. |
indent_style | string | optional | One of tab (default), space2, space4. |
add_block_comments | boolean | optional | Prefix each emitted block with -- BlockName (BlockType). Defaults to false. |
safe_navigation | boolean | optional | Multi-segment Object paths resolve intermediate hops with :FindFirstChild(...) instead of direct indexing. Defaults to false. |
emit_type_annotations | boolean | optional | Annotate types on new local declarations from SetVariable blocks when the type is known. Defaults to false. |
legacy_wait | boolean | optional | Emit wait(n) instead of task.wait(n). Takes priority over use_task_delay_for_wait. Defaults to false. |
Compiles Luau source code into an encoded VS script.
| Field | Type | Required | Description |
|---|---|---|---|
text | string | required | Luau source code. |
service_remap | object | optional | Map of service name overrides, e.g. {"Players": "MyPlayers"}. Defaults to {}. |
remap_textsize_to_fontsize | boolean | optional | Rewrite TextSize property access to FontSize. Defaults to true. |
Compiles Luau source into an encoded VS script using the newer AST-based compiler. Covers locals/assignments, function calls, if/elseif/else, while, and numeric for loops.
| Field | Type | Required | Description |
|---|---|---|---|
text | string | required | Luau source code. |
service_remap | object | optional | Map of service name overrides, e.g. {"Players": "MyPlayers"}. Defaults to {}. |
remap_textsize_to_fontsize | boolean | optional | Rewrite TextSize property access to FontSize. Defaults to true. |
Compiles Luau source using the original almostIDE plugin engine, run standalone outside Roblox Studio.
| Field | Type | Required | Description |
|---|---|---|---|
text | string | required | Luau source code. |
Checks compatibility by actually compiling the input with the selected engine, then analysing what the engine produced or rejected. Each engine reports different things because each engine supports a different subset of Luau. Returns a score from 0–100 and a list of issues. Always returns HTTP 200 — a score of 0 with a compat.error field means the input was invalid or failed to compile, not that the server failed.
| Field | Type | Required | Description |
|---|---|---|---|
compiler | string | required | "TO-VS" to check Luau→VS compatibility. "TO-LUAU" to check VS→Luau compatibility. |
text | string | required | Luau source when compiler is "TO-VS". Encoded VS, decoded-binary VS, or a human-readable block dump when compiler is "TO-LUAU". |
arg1 | string | optional | Only used when compiler is "TO-VS". Selects the engine to test against: "v1", "v2" (default), or "almostlua". Each engine compiles the input for real and the result reflects what that specific engine actually supports. |
[Unsupported] and [unsupported for-in] markers — constructs the compiler could not map to a VS block are emitted as annotated comment blocks instead of being silently dropped, so the scan is exhaustive. A hard parse or codegen failure in v1/v2 sets score to 0 and fills compat.error.compat.score is 0 and compat.error contains the reason. The response is still HTTP 200.Compresses a JSON value into the PotatoMod format (deflate + base93, prefixed with PotatoModHeader_). Mirrors the compressTable function from the PotatoMod v2.3 plugin.
| Field | Type | Required | Description |
|---|---|---|---|
text | string | required | A valid JSON string (object or array) to compress. |
Decompresses a PotatoMod-encoded string back into pretty-printed JSON. Roblox types (Color3, Vector3, CFrame, etc.) are deserialized into readable constructor strings (e.g. Color3.fromRGB(...)).
| Field | Type | Required | Description |
|---|---|---|---|
text | string | required | String starting with PotatoModHeader_. |
Compresses plain text using the RetroCompress LZW algorithm (port of RetroCompress.lua from the almostIDE / SaveBlockArray plugin). Output is a custom base93 stream, not deflate-based.
| Field | Type | Required | Description |
|---|---|---|---|
text | string | required | Any plain text to compress. |
Decompresses a RetroCompress string back into plain text.
| Field | Type | Required | Description |
|---|---|---|---|
text | string | required | String starting with ! (RetroCompress format). |
Converts a decoded VS script string into a structured JSON representation of the block tree.
| Field | Type | Required | Description |
|---|---|---|---|
text | string | required | Decoded VS script text. |
On failure, returns {"ok": false, "error": "..."} instead.
Converts a block tree JSON (as produced by /VS-TO-JSON2) back into an encoded VS script string.
| Field | Type | Required | Description |
|---|---|---|---|
Editor | object | optional | Editor metadata (CameraPosition, CameraZoom). Defaults to 0,0 / 1. |
Blocks | array | required | Array of block objects matching the /VS-TO-JSON2 output schema. |
Converts an encoded or decoded VisualSource string into a JSON structure with lowercase field names. Used internally by /encode. For the capitalized BlockType/Inputs schema, use /VS-TO-JSON2 instead.
| Field | Type | Required | Description |
|---|---|---|---|
text | string | required | Encoded or decoded VS script text. |
Converts a JSON structure (as produced by /VS-TO-JSON) back into an encoded VisualSource string. Used internally by /encode. For the capitalized BlockType/Inputs schema, use /JSON-TO-VS2 instead.
| Field | Type | Required | Description |
|---|---|---|---|
blocks | array | required | Array of block objects matching the /VS-TO-JSON output schema. |
editor | object | optional | Editor metadata (camera_x, camera_y, camera_zoom). Defaults to {}. |
comments | array | optional | Array of comment objects to embed in the script. Defaults to []. |
Converts an uploaded image into a VS script that recreates it as a grid of parts. Accepts multipart/form-data, not JSON.
| Field | Type | Required | Description |
|---|---|---|---|
image | file | required | Image file to convert. |
size | integer | optional | Target grid resolution. Defaults to 100, clamped between 1 and 256. |
Converts a JSON tree of Roblox instances into a valid .rbxmx file (XML format version 4). Script instances with a VisualSource property are automatically compiled to Luau. Returns raw XML, not JSON.
| Field | Type | Required | Description |
|---|---|---|---|
Either an array of instance objects, or a dict of {id: instance}. Each instance carries ClassName, Name, Parent (or ParentID), and its properties. | |||
| Parameter | Type | Required | Description |
|---|---|---|---|
rename_velocity | boolean | optional | Convert legacy Velocity/RotVelocity to AssemblyLinearVelocity/AssemblyAngularVelocity. Defaults to false. |
emit_unique_id | boolean | optional | Include a synthetic UniqueId on each instance. Defaults to true. |
parallelize_threshold | integer | optional | Loop blocks with more direct children than this run the extra children in task.spawn. Defaults to 0. |
wrap_in_pcall | boolean | optional | Wrap parallelized loop children and function bodies in pcall, logging errors via warn(). Defaults to false. |
strict_mode | boolean | optional | Adds --!strict to the top of the generated Luau. Defaults to false. |
minify | boolean | optional | Strip comments and compact whitespace in generated Luau. Defaults to false. |
use_task_delay_for_wait | boolean | optional | Wait blocks with children emit task.delay instead of task.wait followed by the children inline. Ignored if legacy_wait is on. Defaults to false. |
indent_style | string | optional | One of tab (default), space2, space4. |
add_block_comments | boolean | optional | Prefix each emitted block with -- BlockName (BlockType). Defaults to false. |
safe_navigation | boolean | optional | Multi-segment Object paths resolve intermediate hops with :FindFirstChild(...) instead of direct indexing. Defaults to false. |
emit_type_annotations | boolean | optional | Annotate types on new local declarations from SetVariable blocks when the type is known. Defaults to false. |
legacy_wait | boolean | optional | Emit wait(n) instead of task.wait(n). Takes priority over use_task_delay_for_wait. Defaults to false. |
VisualSource property, which get compiled to Luau automatically. Non-fatal warnings (e.g. ambiguous hierarchy) are returned in the X-Rbxmx-Warnings response header, separated by |.
Parses a decoded VS script and returns a preview-oriented block structure used by the VS Preview panel. Also accepts GET with ?text= as a query parameter.
| Field | Type | Required | Description |
|---|---|---|---|
text | string | required | Decoded VS script text. |
Looks up a block by type name and returns its metadata from the block list. Also accepts POST with {"name": "..."} as the body.
| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | required | Block type name (e.g. Print, PlayerAdded). |