Overview
TheBasicClient class is a stripped-down version of Client designed for simple operations like user lookups and stats fetching. Use this when you don’t need party or friend features.
BasicClient does not support:- Parties (except
fetch_party()) - Friends
- XMPP messaging and most events
Constructor
The authentication method to use. See Authentication for available methods.
The connector to use for HTTP connection pooling.
Configuration for HTTP retries.
The Fortnite build version string.
The OS version string for the user agent.
Whether to cache User objects. Disable for programs with many users to reduce memory usage.
Whether to kill other existing sessions/tokens on login.
Attributes
The user the client is logged in as.
Supported Events
event_ready
Dispatched when the client is ready.
event_before_start
Dispatched before the client starts.
event_before_close
Dispatched before the client closes.
event_restart
Dispatched when the client restarts.
event_device_auth_generate
Dispatched when device auth is generated.
event_auth_refresh
Dispatched when authentication is refreshed.
Methods
run
AuthException- Invalid credentials or authentication failureHTTPException- Request error during login
start
Whether to dispatch the
ready event when ready.StartContext - Can be used as async context manager or awaited.
Raises:
AuthException- Invalid credentials or authentication failureHTTPException- Request error during login
close
Whether to close the HTTP client session.
Whether to dispatch close events.
HTTPException- Error during logout
is_closed
True if closed, else False.is_ready
True if ready, else False.wait_until_ready
wait_until_closed
restart
AuthException- Invalid credentials or authentication failureHTTPException- Request error during login
User Methods
fetch_user
User ID or display name.
Whether to check cache before making API request.
Whether to return raw API data instead of User object.
The user if found, else
None.HTTPException- Request error
fetch_users
Iterable of user IDs or display names.
Whether to check cache before making API requests.
Whether to return raw API data.
List of found users. Missing users are not included.
HTTPException- Request error
fetch_user_by_display_name
The user’s display name.
Whether to check cache first.
Whether to return raw API data.
The user if found, else
None.HTTPException- Request error
fetch_users_by_display_name
The display name to search for.
Whether to return raw API data.
List of all matching users.
HTTPException- Request error
search_users
The search prefix (case insensitive).
The platform to search on.
Ordered list of matching users.
HTTPException- Request error
get_user
The user’s ID.
The user if cached, else
None.Stats Methods
fetch_br_stats
The user’s ID.
UTC start time (epoch seconds, datetime, or Season.start_timestamp).
UTC end time (epoch seconds, datetime, or Season.end_timestamp).
Stats object for the user.
Forbidden- User has hidden statsHTTPException- Request error
fetch_ranked_stats
The user’s ID.
The season to get ranks for. Defaults to current season.
List of all ranks for the season.
HTTPException- Request error
fetch_multiple_br_stats
List of user IDs.
List of stats to fetch. Use
StatsV2.create_stat() to create stat strings.UTC start time.
UTC end time.
Mapping of user IDs to their stats. Users with private stats are excluded.
HTTPException- Request error
fetch_battlepass_level
The user’s ID.
The season to get the level for.
UTC start time.
UTC end time.
Battle Pass level with decimal progress (e.g., 208.63 = Level 208, 63% to 209).
Forbidden- User has private career boardHTTPException- Request error
Friend Management
add_friend
The user’s ID.
NotFound- User does not existDuplicateFriendship- Already friendsFriendshipRequestAlreadySent- Request already pendingMaxFriendshipsExceeded- Client hit friendship limit (usually 1000)InviteeMaxFriendshipsExceeded- User hit friendship limitInviteeMaxFriendshipRequestsExceeded- User hit request limit (usually 700)Forbidden- Cannot send request due to user settingsHTTPException- Request error
remove_or_decline_friend
The user’s ID.
HTTPException- Request error
block_user
The user’s ID.
HTTPException- Request error
unblock_user
The user’s ID.
HTTPException- Request error
fetch_blocklist
List of blocked user IDs.
HTTPException- Request error
Event Handling
event
TypeError- Decorated function is not a coroutine
wait_for
Event name (without
event_ prefix).Predicate function to filter events.
Timeout in seconds.
None means wait forever.Event arguments (single value, tuple, or None).
asyncio.TimeoutError- Timeout exceeded
add_event_handler
Event name.
Coroutine function to handle the event.
TypeError- Function is not a coroutine
remove_event_handler
Event name.
Coroutine to remove.
Store and News
fetch_item_shop
Object representing the item shop.
HTTPException- Request error
fetch_br_news
List of news posts.
HTTPException- Request error
fetch_br_playlists
List of all playlists.
HTTPException- Request error
fetch_party
The party’s ID.
The party if found, else
None.Forbidden- Not allowed to look up this partyHTTPException- Request error