SDK Examples
Code examples for popular languages and platforms.
Python
Using the requests library:
import requests
url = "https://rbx-group-fetcher.dimasuperotovorot3000.workers.dev/"
payload = {
"username": "PapaAleks11",
"includeAvatar": True,
"includePresence": True,
"includeGroups": True
}
response = requests.post(url, json=payload)
data = response.json()
if response.status_code == 200:
print(f"User: {data['username']}")
print(f"Display Name: {data['displayName']}")
print(f"Groups: {len(data.get('groups', []))}")
if 'avatarUrl' in data:
print(f"Avatar: {data['avatarUrl']}")
else:
print(f"Error: {data.get('error', 'Unknown error')}")
Using httpx (async):
import httpx
import asyncio
async def fetch_user(username):
url = "https://rbx-group-fetcher.dimasuperotovorot3000.workers.dev/"
payload = {"username": username, "includeAvatar": True}
async with httpx.AsyncClient() as client:
response = await client.post(url, json=payload)
return response.json()
# Usage
data = asyncio.run(fetch_user("PapaAleks11"))
print(data)
JavaScript / TypeScript
Using fetch (browser or Node.js 18+):
async function fetchUserInfo(username) {
const url = "https://rbx-group-fetcher.dimasuperotovorot3000.workers.dev/";
const payload = {
username: username,
includeAvatar: true,
includePresence: true,
includeGroups: true
};
try {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(payload)
});
const data = await response.json();
if (response.ok) {
console.log(`User: ${data.username}`);
console.log(`Display Name: ${data.displayName}`);
console.log(`Groups: ${data.groups?.length || 0}`);
return data;
} else {
throw new Error(data.error || 'Request failed');
}
} catch (error) {
console.error('Error:', error);
throw error;
}
}
// Usage
fetchUserInfo('PapaAleks11')
.then(data => console.log(data))
.catch(err => console.error(err));
Using axios:
const axios = require('axios');
async function fetchUserInfo(username) {
const url = "https://rbx-group-fetcher.dimasuperotovorot3000.workers.dev/";
try {
const response = await axios.post(url, {
username: username,
includeAvatar: true,
includeGroups: true
});
return response.data;
} catch (error) {
if (error.response) {
console.error('Error:', error.response.data);
} else {
console.error('Error:', error.message);
}
throw error;
}
}
curl
Basic request:
curl -X POST https://rbx-group-fetcher.dimasuperotovorot3000.workers.dev/ \
-H "Content-Type: application/json" \
-d '{"username": "PapaAleks11", "includeAvatar": true}'
With all optional parameters:
curl -X POST https://rbx-group-fetcher.dimasuperotovorot3000.workers.dev/ \
-H "Content-Type: application/json" \
-d '{
"username": "PapaAleks11",
"includeAvatar": true,
"includePresence": true,
"includeFriendsCount": true,
"includeFollowersCount": true,
"includeFollowingCount": true,
"includeGroups": true,
"groupId": 4914494
}'
Pretty-print JSON response:
curl -X POST https://rbx-group-fetcher.dimasuperotovorot3000.workers.dev/ \
-H "Content-Type: application/json" \
-d '{"username": "PapaAleks11"}' \
| python -m json.tool
Roblox Lua
Using HttpService:
local HttpService = game:GetService("HttpService")
local function fetchUserInfo(username)
local url = "https://rbx-group-fetcher.dimasuperotovorot3000.workers.dev/"
local payload = {
username = username,
includeAvatar = true,
includeGroups = true
}
local success, result = pcall(function()
local response = HttpService:PostAsync(url, HttpService:JSONEncode(payload), Enum.HttpContentType.ApplicationJson)
return HttpService:JSONDecode(response)
end)
if success then
return result
else
warn("Error fetching user info:", result)
return nil
end
end
-- Usage
local userData = fetchUserInfo("PapaAleks11")
if userData then
print("Username:", userData.username)
print("Display Name:", userData.displayName)
print("Groups:", #userData.groups)
end
With error handling:
local HttpService = game:GetService("HttpService")
local function fetchUserInfo(username)
local url = "https://rbx-group-fetcher.dimasuperotovorot3000.workers.dev/"
local payload = HttpService:JSONEncode({
username = username,
includeAvatar = true,
includePresence = true
})
local success, response = pcall(function()
return HttpService:PostAsync(url, payload, Enum.HttpContentType.ApplicationJson)
end)
if not success then
warn("HTTP request failed:", response)
return nil
end
local success2, data = pcall(function()
return HttpService:JSONDecode(response)
end)
if not success2 then
warn("JSON decode failed:", data)
return nil
end
if data.error then
warn("API error:", data.error)
return nil
end
return data
end
Tips
- Always handle errors and check HTTP status codes
- Implement retry logic with exponential backoff for rate limits
- Cache responses when possible (user data doesn't change frequently)
- Use async/await or promises for better performance
- Validate input before making requests
- Check the Rate Limits page for best practices