Client¶
The main client classes for interacting with the Geometry Dash API.
Both Client (synchronous) and AsyncClient (asynchronous) are available.
Client (Sync)¶
gdpy.client.Client ¶
Synchronous client for interacting with the Geometry Dash API.
This client provides methods to interact with Geometry Dash's private API, including user lookups, level searches, and authentication.
Based on the Geometry Dash API documentation: https://github.com/Rifct/gd-docs
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_url | str | None | Optional custom base URL for the API. Defaults to boomlings.com. | None |
Example:
client = Client()
user = client.get_user(account_id=71)
print(user.username)
client.close()
# Or use as context manager:
with Client() as client:
user = client.get_user(account_id=71)
print(user.username)
Initialize the client.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_url | str | None | Optional custom base URL for the API. | None |
Source code in gdpy/client.py
accept_friend_request ¶
Accept a friend request. Requires authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request_id | int | The friend request ID. | required |
Returns:
| Type | Description |
|---|---|
bool | True if accepted successfully. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
Source code in gdpy/client.py
block_user ¶
Block a user. Requires authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_id | int | The user's account ID to block. | required |
Returns:
| Type | Description |
|---|---|
bool | True if blocked successfully. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
Source code in gdpy/client.py
close ¶
delete_friend_request ¶
Delete a friend request. Requires authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request_id | int | The friend request ID. | required |
Returns:
| Type | Description |
|---|---|
bool | True if deleted successfully. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
Source code in gdpy/client.py
delete_level ¶
Delete a level. Requires authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_id | int | The level ID to delete. | required |
Returns:
| Type | Description |
|---|---|
bool | True if deleted successfully. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
Source code in gdpy/client.py
delete_level_comment ¶
Delete a level comment. Requires authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
comment_id | int | The comment ID to delete. | required |
level_id | int | The level ID the comment is on. | required |
Returns:
| Type | Description |
|---|---|
bool | True if deleted successfully. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
Source code in gdpy/client.py
delete_message ¶
Delete a message. Requires authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message_id | int | The message ID to delete. | required |
Returns:
| Type | Description |
|---|---|
bool | True if deleted successfully. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
Source code in gdpy/client.py
delete_profile_comment ¶
Delete a profile comment. Requires authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
comment_id | int | The comment ID to delete. | required |
Returns:
| Type | Description |
|---|---|
bool | True if deleted successfully. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
Source code in gdpy/client.py
get_account_comments ¶
Get comments on a user's profile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account_id | int | The account ID of the user. | required |
limit | int | Maximum number of comments to return. | 10 |
page | int | Page number for pagination. | 0 |
Returns:
| Type | Description |
|---|---|
list[Comment] | List of Comment objects. |
Source code in gdpy/client.py
get_blocked_users ¶
Get blocked users list. Requires authentication.
Returns:
| Type | Description |
|---|---|
list[User] | List of User objects. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
Source code in gdpy/client.py
get_challenges ¶
Get daily challenges/quests. Requires authentication.
Source code in gdpy/client.py
get_chest_rewards ¶
Get chest reward information. Requires authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reward_type | int | 0 for info, 1 for small chest, 2 for large chest. | 0 |
Source code in gdpy/client.py
get_comment_history ¶
get_comment_history(
user_id: int,
limit: int = 10,
page: int = 0,
mode: str = "recent",
) -> list[Comment]
Get a user's comment history (comments they've posted on levels).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_id | int | The user's ID (not account ID). | required |
limit | int | Maximum number of comments to return. | 10 |
page | int | Page number for pagination. | 0 |
mode | str | "recent" or "liked". | 'recent' |
Returns:
| Type | Description |
|---|---|
list[Comment] | List of Comment objects. |
Source code in gdpy/client.py
get_daily_level ¶
Get the current daily/weekly level info.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type | str | "daily", "weekly", or "event". | 'daily' |
Returns:
| Type | Description |
|---|---|
DailyLevel | DailyLevel object with index and time_left. |
Source code in gdpy/client.py
get_friend_requests ¶
Get friend requests. Requires authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit | int | Maximum number of requests to return. | 10 |
page | int | Page number for pagination. | 0 |
sent | bool | If True, get sent requests instead of received. | False |
Returns:
| Type | Description |
|---|---|
list[FriendRequest] | List of FriendRequest objects. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
Source code in gdpy/client.py
get_friends ¶
Get friends list. Requires authentication.
Returns:
| Type | Description |
|---|---|
list[User] | List of User objects. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
Source code in gdpy/client.py
get_gauntlets ¶
Get all gauntlets.
Returns:
| Type | Description |
|---|---|
list[Gauntlet] | List of Gauntlet objects. |
Source code in gdpy/client.py
get_leaderboard ¶
Get the leaderboard.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit | int | Maximum number of results (max 100). | 100 |
type | str | Leaderboard type - "top" or "creators". | 'top' |
Returns:
| Type | Description |
|---|---|
list[LeaderboardScore] | List of LeaderboardScore objects. |
Source code in gdpy/client.py
get_level ¶
Get a level by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_id | int | The ID of the level. | required |
Returns:
| Type | Description |
|---|---|
Level | Level object with level information. |
Raises:
| Type | Description |
|---|---|
NotFoundError | If level is not found. |
InvalidRequestError | If rate limited. |
Source code in gdpy/client.py
get_level_comments ¶
Get comments for a level.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_id | int | The ID of the level. | required |
limit | int | Maximum number of comments to return. | 10 |
page | int | Page number for pagination. | 0 |
Returns:
| Type | Description |
|---|---|
list[Comment] | List of Comment objects. |
Source code in gdpy/client.py
get_level_lists ¶
Get level lists (user-created lists of levels).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit | int | Maximum number of lists to return. | 10 |
page | int | Page number for pagination. | 0 |
Returns:
| Type | Description |
|---|---|
list[dict[str, str]] | List of level list dictionaries. |
Source code in gdpy/client.py
get_map_packs ¶
Get map packs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page | int | Page number for pagination. | 0 |
Returns:
| Type | Description |
|---|---|
list[MapPack] | List of MapPack objects. |
Source code in gdpy/client.py
get_message ¶
Download full message content. Requires authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
message_id | int | The message ID to download. | required |
Returns:
| Type | Description |
|---|---|
Message | Message object with full content. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
NotFoundError | If message not found. |
Source code in gdpy/client.py
get_messages ¶
Get inbox or sent messages. Requires authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit | int | Maximum number of messages to return. | 10 |
page | int | Page number for pagination. | 0 |
sent | bool | If True, get sent messages instead of inbox. | False |
Returns:
| Type | Description |
|---|---|
list[Message] | List of Message objects. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
Source code in gdpy/client.py
get_song ¶
Get a custom song by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
song_id | int | The ID of the song. | required |
Returns:
| Type | Description |
|---|---|
Song | Song object with song information. |
Raises:
| Type | Description |
|---|---|
NotFoundError | If song is not found. |
InvalidRequestError | If rate limited. |
Source code in gdpy/client.py
get_top_1000 ¶
Get top 1000 users by stars.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit | int | Maximum number of users to return. | 100 |
page | int | Page number for pagination. | 0 |
Returns:
| Type | Description |
|---|---|
list[User] | List of User objects. |
Source code in gdpy/client.py
get_top_artists ¶
Get RobTop's handpicked top artists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page | int | Page number for pagination. | 0 |
Returns:
| Type | Description |
|---|---|
list[TopArtist] | List of TopArtist objects. |
Source code in gdpy/client.py
get_user ¶
Get a user by their account ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account_id | int | The account ID of the user. | required |
Returns:
| Type | Description |
|---|---|
User | User object with profile information. |
Raises:
| Type | Description |
|---|---|
NotFoundError | If user is not found. |
InvalidRequestError | If rate limited. |
Source code in gdpy/client.py
get_user_levels ¶
Get levels created by a user.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_id | int | The user's ID (not account ID). | required |
limit | int | Maximum number of levels to return. | 10 |
page | int | Page number for pagination. | 0 |
Returns:
| Type | Description |
|---|---|
list[Level] | List of Level objects created by the user. |
Source code in gdpy/client.py
like_comment ¶
Like or dislike a level comment.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
comment_id | int | The comment ID. | required |
like | bool | True to like, False to dislike. | True |
Returns:
| Type | Description |
|---|---|
bool | True if successful. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
Source code in gdpy/client.py
like_level ¶
Like or dislike a level.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_id | int | The level ID. | required |
like | bool | True to like, False to dislike. | True |
Returns:
| Type | Description |
|---|---|
bool | True if successful. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
Source code in gdpy/client.py
login ¶
Login to a Geometry Dash account.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
username | str | Account username. | required |
password | str | Account password. | required |
Returns:
| Type | Description |
|---|---|
bool | True if login successful, False otherwise. |
Raises:
| Type | Description |
|---|---|
InvalidCredentialsError | If credentials are incorrect. |
AccountDisabledError | If account is disabled. |
InvalidRequestError | If rate limited. |
Source code in gdpy/client.py
post_level_comment ¶
Post a comment on a level. Requires authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_id | int | The level ID to comment on. | required |
content | str | The comment content. | required |
percent | int | Optional percentage to display. | 0 |
Returns:
| Type | Description |
|---|---|
int | None | Comment ID if successful, None otherwise. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
Source code in gdpy/client.py
post_profile_comment ¶
Post a comment on your profile. Requires authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
content | str | The comment content. | required |
Returns:
| Type | Description |
|---|---|
int | None | Comment ID if successful, None otherwise. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
Source code in gdpy/client.py
register ¶
Register a new Geometry Dash account.
Uses the pre-2.2 API endpoint. GD 2.2 added captcha protection via register.php web page, but registerGJAccount.php API still works.
Note: GD rejects temporary email addresses.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
username | str | Desired username (min 3 characters). | required |
password | str | Desired password (min 6 characters). | required |
email | str | Email address (must be real, not temp email). | required |
Returns:
| Type | Description |
|---|---|
bool | True if registration successful, False otherwise. |
Raises:
| Type | Description |
|---|---|
UsernameTakenError | If username is already taken. |
EmailTakenError | If email is already registered. |
PasswordTooShortError | If password is too short. |
UsernameTooShortError | If username is too short. |
InvalidEmailError | If email is invalid or blacklisted. |
Source code in gdpy/client.py
remove_friend ¶
Remove a friend. Requires authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
friend_id | int | The friend's account ID. | required |
Returns:
| Type | Description |
|---|---|
bool | True if removed successfully. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
Source code in gdpy/client.py
report_level ¶
Report a level.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_id | int | The level ID to report. | required |
Returns:
| Type | Description |
|---|---|
bool | True if reported successfully. |
Source code in gdpy/client.py
search_levels ¶
Search for levels by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query | str | Search query (level name or partial match). | '' |
limit | int | Maximum number of results per page. | 10 |
page | int | Page number for pagination. | 0 |
Returns:
| Type | Description |
|---|---|
list[Level] | List of Level objects matching the query. |
Source code in gdpy/client.py
search_users ¶
Search for users by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query | str | Search query (username or partial match). | required |
limit | int | Maximum number of results to return. | 10 |
Returns:
| Type | Description |
|---|---|
list[User] | List of User objects matching the query. |
Source code in gdpy/client.py
send_friend_request ¶
Send a friend request. Requires authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recipient_id | int | The recipient's account ID. | required |
message | str | Optional message with the request. | '' |
Returns:
| Type | Description |
|---|---|
bool | True if request sent successfully. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
Source code in gdpy/client.py
send_message ¶
Send a private message. Requires authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
recipient_id | int | The recipient's account ID. | required |
subject | str | Message subject. | required |
body | str | Message body. | required |
Returns:
| Type | Description |
|---|---|
bool | True if message sent successfully. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
Source code in gdpy/client.py
test_song ¶
Test if a custom song is available.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
song_id | int | The song ID to test. | required |
Returns:
| Type | Description |
|---|---|
bool | True if song is available, False otherwise. |
Source code in gdpy/client.py
unblock_user ¶
Unblock a user. Requires authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_id | int | The user's account ID to unblock. | required |
Returns:
| Type | Description |
|---|---|
bool | True if unblocked successfully. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
Source code in gdpy/client.py
upload_level ¶
upload_level(
name: str,
level_string: str,
description: str = "",
level_id: int = 0,
version: int = 1,
length: int = 0,
audio_track: int = 0,
song_id: int = 0,
password: int = 0,
original: int = 0,
two_player: bool = False,
objects: int = 1,
coins: int = 0,
requested_stars: int = 0,
unlisted: int = 0,
ldm: bool = False,
) -> int | None
Upload a level. Requires authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name | str | Level name. | required |
level_string | str | Level data (will be compressed and encoded). | required |
description | str | Level description. | '' |
level_id | int | 0 for new level, or existing level ID to update. | 0 |
version | int | Level version number. | 1 |
length | int | Level length (0=tiny, 4=XL, 5=platformer). | 0 |
audio_track | int | Official song number (0 if using custom song). | 0 |
song_id | int | Custom song ID (0 if using official song). | 0 |
password | int | Copy password (0=none, 1=free copy). | 0 |
original | int | Original level ID if copied. | 0 |
two_player | bool | Whether level uses two player mode. | False |
objects | int | Number of objects in level. | 1 |
coins | int | Number of user coins. | 0 |
requested_stars | int | Requested star rating. | 0 |
unlisted | int | 0=public, 1=friends only, 2=unlisted. | 0 |
ldm | bool | Whether level has low detail mode. | False |
Returns:
| Type | Description |
|---|---|
int | None | The uploaded level ID, or None if failed. |
Raises:
| Type | Description |
|---|---|
RuntimeError | If not authenticated. |
Source code in gdpy/client.py
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 | |
AsyncClient¶
gdpy.client.AsyncClient ¶
Asynchronous client for interacting with the Geometry Dash API.
This client provides async methods to interact with Geometry Dash's private API, including user lookups, level searches, and authentication.
Based on the Geometry Dash API documentation: https://github.com/Rifct/gd-docs
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_url | str | None | Optional custom base URL for the API. Defaults to boomlings.com. | None |
Example:
client = AsyncClient()
user = await client.get_user(account_id=71)
print(user.username)
await client.close()
# Or use as context manager:
async with AsyncClient() as client:
user = await client.get_user(account_id=71)
print(user.username)
Initialize the async client.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base_url | str | None | Optional custom base URL for the API. | None |
Source code in gdpy/client.py
accept_friend_request async ¶
Accept a friend request. Requires authentication.
Source code in gdpy/client.py
block_user async ¶
Block a user. Requires authentication.
Source code in gdpy/client.py
close async ¶
delete_friend_request async ¶
Delete a friend request. Requires authentication.
Source code in gdpy/client.py
delete_level async ¶
Delete a level. Requires authentication.
Source code in gdpy/client.py
delete_level_comment async ¶
Delete a level comment. Requires authentication.
Source code in gdpy/client.py
delete_message async ¶
Delete a message. Requires authentication.
Source code in gdpy/client.py
delete_profile_comment async ¶
Delete a profile comment. Requires authentication.
Source code in gdpy/client.py
get_account_comments async ¶
Get comments on a user's profile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account_id | int | The account ID of the user. | required |
limit | int | Maximum number of comments to return. | 10 |
page | int | Page number for pagination. | 0 |
Returns:
| Type | Description |
|---|---|
list[Comment] | List of Comment objects. |
Source code in gdpy/client.py
get_blocked_users async ¶
Get blocked users list. Requires authentication.
Source code in gdpy/client.py
get_challenges async ¶
Get daily challenges/quests. Requires authentication.
Source code in gdpy/client.py
get_chest_rewards async ¶
Get chest reward information. Requires authentication.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reward_type | int | 0 for info, 1 for small chest, 2 for large chest. | 0 |
Source code in gdpy/client.py
get_comment_history async ¶
get_comment_history(
user_id: int,
limit: int = 10,
page: int = 0,
mode: str = "recent",
) -> list[Comment]
Get a user's comment history (comments they've posted on levels).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_id | int | The user's ID (not account ID). | required |
limit | int | Maximum number of comments to return. | 10 |
page | int | Page number for pagination. | 0 |
mode | str | "recent" or "liked". | 'recent' |
Returns:
| Type | Description |
|---|---|
list[Comment] | List of Comment objects. |
Source code in gdpy/client.py
get_daily_level async ¶
Get the current daily/weekly level info.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
type | str | "daily", "weekly", or "event". | 'daily' |
Returns:
| Type | Description |
|---|---|
DailyLevel | DailyLevel object with index and time_left. |
Source code in gdpy/client.py
get_friend_requests async ¶
Get friend requests. Requires authentication.
Source code in gdpy/client.py
get_friends async ¶
Get friends list. Requires authentication.
Source code in gdpy/client.py
get_gauntlets async ¶
Get all gauntlets.
Returns:
| Type | Description |
|---|---|
list[Gauntlet] | List of Gauntlet objects. |
Source code in gdpy/client.py
get_leaderboard async ¶
Get the leaderboard.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit | int | Maximum number of results (max 100). | 100 |
type | str | Leaderboard type - "top" or "creators". | 'top' |
Returns:
| Type | Description |
|---|---|
list[LeaderboardScore] | List of LeaderboardScore objects. |
Source code in gdpy/client.py
get_level async ¶
Get a level by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_id | int | The ID of the level. | required |
Returns:
| Type | Description |
|---|---|
Level | Level object with level information. |
Raises:
| Type | Description |
|---|---|
NotFoundError | If level is not found. |
InvalidRequestError | If rate limited. |
Source code in gdpy/client.py
get_level_comments async ¶
Get comments for a level.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
level_id | int | The ID of the level. | required |
limit | int | Maximum number of comments to return. | 10 |
page | int | Page number for pagination. | 0 |
Returns:
| Type | Description |
|---|---|
list[Comment] | List of Comment objects. |
Source code in gdpy/client.py
get_level_lists async ¶
Get level lists (user-created lists of levels).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit | int | Maximum number of lists to return. | 10 |
page | int | Page number for pagination. | 0 |
Returns:
| Type | Description |
|---|---|
list[dict[str, str]] | List of level list dictionaries. |
Source code in gdpy/client.py
get_map_packs async ¶
Get map packs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page | int | Page number for pagination. | 0 |
Returns:
| Type | Description |
|---|---|
list[MapPack] | List of MapPack objects. |
Source code in gdpy/client.py
get_message async ¶
Download full message content. Requires authentication.
Source code in gdpy/client.py
get_messages async ¶
Get inbox or sent messages. Requires authentication.
Source code in gdpy/client.py
get_song async ¶
Get a custom song by its ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
song_id | int | The ID of the song. | required |
Returns:
| Type | Description |
|---|---|
Song | Song object with song information. |
Raises:
| Type | Description |
|---|---|
NotFoundError | If song is not found. |
InvalidRequestError | If rate limited. |
Source code in gdpy/client.py
get_top_1000 async ¶
Get top 1000 users by stars.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
limit | int | Maximum number of users to return. | 100 |
page | int | Page number for pagination. | 0 |
Returns:
| Type | Description |
|---|---|
list[User] | List of User objects. |
Source code in gdpy/client.py
get_top_artists async ¶
Get RobTop's handpicked top artists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page | int | Page number for pagination. | 0 |
Returns:
| Type | Description |
|---|---|
list[TopArtist] | List of TopArtist objects. |
Source code in gdpy/client.py
get_user async ¶
Get a user by their account ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
account_id | int | The account ID of the user. | required |
Returns:
| Type | Description |
|---|---|
User | User object with profile information. |
Raises:
| Type | Description |
|---|---|
NotFoundError | If user is not found. |
InvalidRequestError | If rate limited. |
Source code in gdpy/client.py
get_user_levels async ¶
Get levels created by a user.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_id | int | The user's ID (not account ID). | required |
limit | int | Maximum number of levels to return. | 10 |
page | int | Page number for pagination. | 0 |
Returns:
| Type | Description |
|---|---|
list[Level] | List of Level objects created by the user. |
Source code in gdpy/client.py
like_comment async ¶
Like or dislike a level comment.
Source code in gdpy/client.py
like_level async ¶
Like or dislike a level.
Source code in gdpy/client.py
login async ¶
Login to a Geometry Dash account.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
username | str | Account username. | required |
password | str | Account password. | required |
Returns:
| Type | Description |
|---|---|
bool | True if login successful, False otherwise. |
Raises:
| Type | Description |
|---|---|
InvalidCredentialsError | If credentials are incorrect. |
AccountDisabledError | If account is disabled. |
InvalidRequestError | If rate limited. |
Source code in gdpy/client.py
post_level_comment async ¶
Post a comment on a level. Requires authentication.
Source code in gdpy/client.py
post_profile_comment async ¶
Post a comment on your profile. Requires authentication.
Source code in gdpy/client.py
register async ¶
Register a new Geometry Dash account.
Uses the pre-2.2 API endpoint. GD 2.2 added captcha protection via register.php web page, but registerGJAccount.php API still works.
Note: GD rejects temporary email addresses.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
username | str | Desired username (min 3 characters). | required |
password | str | Desired password (min 6 characters). | required |
email | str | Email address (must be real, not temp email). | required |
Returns:
| Type | Description |
|---|---|
bool | True if registration successful, False otherwise. |
Raises:
| Type | Description |
|---|---|
UsernameTakenError | If username is already taken. |
EmailTakenError | If email is already registered. |
PasswordTooShortError | If password is too short. |
UsernameTooShortError | If username is too short. |
InvalidEmailError | If email is invalid or blacklisted. |
Source code in gdpy/client.py
remove_friend async ¶
Remove a friend. Requires authentication.
Source code in gdpy/client.py
report_level async ¶
Report a level.
search_levels async ¶
Search for levels by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query | str | Search query (level name or partial match). | '' |
limit | int | Maximum number of results per page. | 10 |
page | int | Page number for pagination. | 0 |
Returns:
| Type | Description |
|---|---|
list[Level] | List of Level objects matching the query. |
Source code in gdpy/client.py
search_users async ¶
Search for users by name.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query | str | Search query (username or partial match). | required |
limit | int | Maximum number of results to return. | 10 |
Returns:
| Type | Description |
|---|---|
list[User] | List of User objects matching the query. |
Source code in gdpy/client.py
send_friend_request async ¶
Send a friend request. Requires authentication.
Source code in gdpy/client.py
send_message async ¶
Send a private message. Requires authentication.
Source code in gdpy/client.py
test_song async ¶
Test if a custom song is available.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
song_id | int | The song ID to test. | required |
Returns:
| Type | Description |
|---|---|
bool | True if song is available, False otherwise. |
Source code in gdpy/client.py
unblock_user async ¶
Unblock a user. Requires authentication.
Source code in gdpy/client.py
upload_level async ¶
upload_level(
name: str,
level_string: str,
description: str = "",
level_id: int = 0,
version: int = 1,
length: int = 0,
audio_track: int = 0,
song_id: int = 0,
password: int = 0,
original: int = 0,
two_player: bool = False,
objects: int = 1,
coins: int = 0,
requested_stars: int = 0,
unlisted: int = 0,
ldm: bool = False,
) -> int | None
Upload a level. Requires authentication.
Source code in gdpy/client.py
1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 | |