https://github.com/riisdev/scriptbloxapi
API For ScritBlox.com
https://github.com/riisdev/scriptbloxapi
Last synced: about 1 year ago
JSON representation
API For ScritBlox.com
- Host: GitHub
- URL: https://github.com/riisdev/scriptbloxapi
- Owner: RiisDev
- Created: 2023-05-22T08:00:07.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-07T01:29:27.000Z (about 1 year ago)
- Last Synced: 2025-04-07T01:35:13.778Z (about 1 year ago)
- Language: C#
- Size: 46.5 MB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ScriptBlox API
[](https://discord.gg/yyuggrH)   
## License
[MIT](https://choosealicense.com/licenses/mit)
## Documentation
Follows [ScriptBloxAPI Standards and Parameters](https://scriptblox.com/docs/scripts/fetch)
---
# ScriptBloxApi - Scripts Module
The `Scripts` class in the `ScriptBloxApi` library provides a set of asynchronous methods to interact with the ScriptBlox API for fetching, searching, and retrieving Roblox scripts.
## โจ Features
- Fetch paginated script lists with filters
- Retrieve specific script data
- Get raw script code
- Access trending scripts
- Perform advanced search queries
---
## ๐ Usage
Make sure to call these methods from an async context.
```csharp
using ScriptBloxApi.Scripts;
using ScriptBloxApi.Objects;
Results scripts = await Scripts.FetchScriptsAsync();
ScriptData script = await Scripts.FetchScriptAsync("abc123");
string rawScript = await Scripts.FetchRawScriptAsync("abc123");
IReadOnlyList trending = await Scripts.FetchTrendingScriptsAsync();
IReadOnlyList<Script> searchResults = await Scripts.SearchScriptsAsync("infinite yield");
```
---
## ๐ API Reference
### `FetchScriptsAsync(...)`
Fetches a paginated list of scripts with optional filtering and sorting.
**Parameters:**
| Name | Type | Description |
|-------------|------------------|----------------------------------------------|
| `page` | `int?` | Page number (default: 1) |
| `max` | `int?` | Max results per page (1โ20, default: 20) |
| `mode` | `ScriptCost?` | Filter by script cost (`free`, `paid`) |
| `patched` | `bool?` | Include only patched scripts if `true` |
| `key` | `bool?` | Include only key-protected scripts if `true`|
| `universal` | `bool?` | Filter universal scripts |
| `verified` | `bool?` | Include only verified scripts |
| `sortBy` | `SortBy?` | Sort field (`views`, `likeCount`, etc.) |
| `order` | `Order?` | Sort order (`asc`, `desc`) |
**Returns:** `Task<Results>`
---
### `FetchScriptAsync(string scriptId)`
Fetches metadata for a single script by ID.
**Parameters:**
- `scriptId`: The ID of the script to fetch
**Returns:** `Task<ScriptData>`
---
### `FetchRawScriptAsync(string scriptId)`
Fetches the raw Lua source code for a script by ID.
**Parameters:**
- `scriptId`: The ID of the script
**Returns:** `Task<string>`
---
### `FetchTrendingScriptsAsync(int? max = 20)`
Gets trending scripts, optionally limited to a maximum number.
**Parameters:**
- `max`: Maximum number of scripts (1โ20, default: 20)
**Returns:** `Task<IReadOnlyList<Script>>`
---
### `SearchScriptsAsync(...)`
Performs an advanced search for scripts based on a query and filters.
**Parameters:**
| Name | Type | Description |
|-------------|------------------|----------------------------------------------|
| `query` | `string` | The search query |
| `page` | `int?` | Page number (default: 1) |
| `max` | `int?` | Max results per page (1โ20, default: 20) |
| `mode` | `ScriptCost?` | Filter by script cost (`free`, `paid`) |
| `patched` | `bool?` | Filter by patched state |
| `key` | `bool?` | Filter by key-protection |
| `universal` | `bool?` | Filter by universal scripts |
| `verified` | `bool?` | Filter by verified scripts |
| `sortBy` | `SortBy?` | Sort field |
| `order` | `Order?` | Sort order |
| `strict` | `bool?` | Use strict match if `true` |
**Returns:** `Task<Results>`
---
## ๐ Enums
### `ScriptCost`
- `free`
- `paid`
### `SortBy`
- `views`
- `likeCount`
- `createdAt`
- `updatedAt`
- `dislikeCount`
### `Order`
- `asc`
- `desc`
---
## ๐งช Example: Search for Free, Verified Scripts
```csharp
var results = await Scripts.SearchScriptsAsync(
query: "admin",
mode: Scripts.ScriptCost.free,
verified: true,
sortBy: Scripts.SortBy.views,
order: Scripts.Order.desc
);
```