# MoonSec REST API docs

## Obfuscate a script

<mark style="color:green;">`POST`</mark> `https://api.f3d.at/v1/obfuscate.php?key={api_key}&options={parameters}&bytecode={number}&platform={parameter}`

This endpoint allows you to obfuscate your scripts. \
Note that parameter values are **NOT case sensitive**. Which means you can do `platform=Roblox` or `platform=roblOX`. It doesn't matter.

#### Path Parameters

| Name | Type   | Description                               |
| ---- | ------ | ----------------------------------------- |
| v1   | string | Version of the API. This is currently v1. |

#### Query Parameters

| Name     | Type    | Description                                                                                                                                              |
| -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| key      | string  | API key.                                                                                                                                                 |
| options  | string  | Specifies which features you want to enable. If you don't include this param, it will be maximum by default. You can find a list of valid options below. |
| bytecode | integer | Specifies the bytecode appearance. Default is `2`.  You can find a list of them below                                                                    |
| platform | string  | Specifies the platform lock. Default is "lua". Valid platforms are: `lua, roblox, csgo`                                                                  |

#### Request Body

| Name | Type   | Description                           |
| ---- | ------ | ------------------------------------- |
|      | string | Request body must be your raw script. |

{% tabs %}
{% tab title="200 Code has been obfuscated. This will return you the obfuscated script as a raw text body." %}

```
_5FQkEjQlBehFAQjaA, Protected_by_MoonSecV2, Discord = 'discord.gg/gQEH2uZxUk' ,nil,nil;(function() _msec=(function(_,e,l)local W=e........
```

{% endtab %}

{% tab title="400 You set the 'bytecode' parameter something invalid. It must be an integer between 0 and 6." %}

```
```

{% endtab %}

{% tab title="403 You are probably missing the API key in query, or your API key is invalid" %}

```
```

{% endtab %}

{% tab title="413 Entity too large means your script is either too small (even empty) or too big (over 8mb)." %}

```
```

{% endtab %}

{% tab title="429 This means you are being ratelimited. You can obfuscate 1 file per 5 seconds, attempting to exceed this limit will result a 429." %}

```
```

{% endtab %}

{% tab title="500 This happens when obfuscation fails. If it's a syntax error, you will receive a description of the error." %}

```
moonsec_cli:5: Unfinished string near ")"
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Options Parameter" %}
Options must be connected with + in the query. Example:

```csharp
// example code
var request = (HttpWebRequest)WebRequest.Create("https://api.f3d.at/v1/obfuscate.php?key=0000bfbf&options=stringencryption+antidump&platform=Roblox&bytecode=3");


byte[] _byteScript = Encoding.UTF8.GetBytes(script);
request.Method = "POST";
request.ContentType = "text/html charset=utf-8;";
request.ContentLength = _byteScript.Length;
using (var stream = request.GetRequestStream())
{
    stream.Write(_byteScript, 0, _byteScript.Length);
}
			
			
try{
			var response = (HttpWebResponse)request.GetResponse();
			var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
			richTextBox2.Text = responseString;
}
catch (WebException ex) { 
			MessageBox.Show(ex.Message); 
}


```

#### Current options: (they are not case sensitive)

* StringEncryption
* ConstantEncryption
* AntiDump
* SmallOutput
  {% endtab %}

{% tab title="Bytecode Parameter" %}
There are **7** bytecode options as of now.

* 0  :  Arabic
* 1  :  Letters 1
* 2  :  Symbols 1   *(?^+%&/()€#)*
* 3  :  Russian
* 4  :  Whitespace
* 5  :  Chinese
* 6  :  Emoji
  {% endtab %}

{% tab title="Platform Parameter" %}
There are 3 platforms for now.

* lua  :  Runs on all platforms, but roblox.
* roblox  :  Runs only on roblox.
* csgo  :  Runs on CS:GO executors.
  {% endtab %}
  {% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cmoonm4n.gitbook.io/moonsec-obfuscator/moonsec-rest-api-docs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
