robloxapi
A clean Python wrapper around the public Roblox web APIs.
Installation
pip install .
pip install -e .
Requires: Python 3.8+, requests
Quickstart
from robloxapi import RobloxClient
client = RobloxClient()
client = RobloxClient(cookie="YOUR_.ROBLOSECURITY_COOKIE")
API Reference
👤 Users — client.users
user = client.users.get_user(1)
print(user["name"])
results = client.users.search_users("builderman", limit=10)
users = client.users.get_users_by_ids([1, 156])
users = client.users.get_users_by_usernames(["Roblox", "builderman"])
history = client.users.get_username_history(156)
me = client.users.get_authenticated_user()
🎮 Games — client.games
game = client.games.get_games([2753915549])
print(game["data"][0]["visits"])
visits = client.games.get_game_visits([2753915549, 286090429])
info = client.games.get_game_by_place_id(6872265039)
page = client.games.get_games_page(limit=10)
results = client.games.search_games("obby", limit=20)
user_games = client.games.get_games_by_user(156)
group_games = client.games.get_games_by_group(2868472)
servers = client.games.get_game_servers(place_id=6872265039, limit=10)
passes = client.games.get_game_passes(universe_id=2753915549)
votes = client.games.get_game_votes([2753915549])
places = client.games.get_place_details([6872265039])
🛍️ Catalog — client.catalog
items = client.catalog.search_catalog(
keyword="fedora",
category="Accessories",
sort_type="Sales",
limit=30,
)
details = client.catalog.get_asset_details(asset_id=1028606)
details = client.catalog.get_item_details([
{"itemType": "Asset", "id": 1028606},
{"itemType": "Bundle", "id": 192},
])
bundle = client.catalog.get_bundle_details(192)
resale = client.catalog.get_asset_resale_data(asset_id=1028606)
sellers = client.catalog.get_asset_resellers(asset_id=1028606)
👥 Groups — client.groups
group = client.groups.get_group(2868472)
roles = client.groups.get_group_roles(2868472)
members = client.groups.get_group_members(2868472, limit=50)
members = client.groups.get_group_members(2868472, role_id=12345)
user_groups = client.groups.get_user_groups(user_id=156)
results = client.groups.search_groups("builders")
wall = client.groups.get_group_wall(2868472, limit=10)
funds = client.groups.get_group_funds(2868472)
🤝 Friends — client.friends
friends = client.friends.get_friends(user_id=156)
print(client.friends.get_friend_count(156)["count"])
print(client.friends.get_follower_count(156)["count"])
print(client.friends.get_following_count(156)["count"])
followers = client.friends.get_followers(156, limit=50)
followings = client.friends.get_followings(156, limit=50)
requests = client.friends.get_friend_requests(limit=20)
🖼️ Thumbnails — client.thumbnails
thumbs = client.thumbnails.get_user_avatars([1, 156], size="420x420")
for t in thumbs["data"]:
print(t["targetId"], t["imageUrl"])
heads = client.thumbnails.get_user_avatar_headshots([1, 156])
icons = client.thumbnails.get_game_icons([2753915549])
shots = client.thumbnails.get_game_thumbnails([2753915549], count_per_universe=3)
asset_thumbs = client.thumbnails.get_asset_thumbnails([1028606])
bundle_thumbs = client.thumbnails.get_bundle_thumbnails([192])
group_icons = client.thumbnails.get_group_icons([2868472])
🏅 Badges — client.badges
badge = client.badges.get_badge(2124445228)
badges = client.badges.get_universe_badges(universe_id=2753915549)
user_badges = client.badges.get_user_badges(user_id=156)
dates = client.badges.get_badge_awarded_dates(
user_id=156,
badge_ids=[2124445228, 2124445229],
)
Most list endpoints return cursor-based pagination. Loop through pages like this:
cursor = None
all_friends = []
while True:
page = client.friends.get_followers(user_id=156, limit=100, cursor=cursor)
all_friends.extend(page["data"])
cursor = page.get("nextPageCursor")
if not cursor:
break
print(f"Total followers fetched: {len(all_friends)}")
Authentication
Certain endpoints (friend requests, group funds, authenticated user info) require
a valid .ROBLOSECURITY cookie. You can obtain this from your browser's cookies
while logged into roblox.com.
⚠️ Never share your .ROBLOSECURITY cookie. Treat it like a password.
client = RobloxClient(cookie="_|WARNING:-DO-NOT-SHARE-THIS-...")
me = client.users.get_authenticated_user()
Error handling
All methods raise requests.HTTPError on non-2xx responses:
from requests import HTTPError
try:
user = client.users.get_user(99999999999)
except HTTPError as e:
print(f"Error {e.response.status_code}: {e.response.text}")
License
MIT