GET User Friends
/openmlbb/user/friends
API Path: /api/user/friends
Retrieve the authenticated player's friends information using a valid JWT. Supports query parameters for season filtering and localization. Requires an Authorization header with the JWT from login.
Headers:
- Authorization:
Bearer <jwt>(JWT obtained during login).
Query parameters:
- sid: Season ID for filtering friends (must be a valid season ID from
/api/user/season). - lang: Language code for localized content (default:
en).
The response includes friend statistics and metadata:
- bfs: Best Friends (highlighted or prioritized friends list, may be null).
- wfs: Weekly Friends (friends interacted with recently, may be empty).
- fs: Friends list entries, each containing:
- f: Friend object with identifiers:
- rid: Role ID (unique player identifier).
- zid: Zone ID (server region).
- n: Name (may be empty if private).
- ax: Avatar URL (may be empty).
- pri: Privacy flag (true if details are hidden).
- frid: Friend Role ID (unique identifier for the friend).
- fzid: Friend Zone ID (server region for the friend).
- cl: Current Level of the friend.
- l: Level (same as cl, sometimes duplicated).
- tbc: Total Battle Count (matches played together).
- twc: Total Win Count (matches won together).
- f: Friend object with identifiers:
This endpoint is useful for:
- Displaying a player's friend list.
- Tracking shared match history.
- Analyzing cooperative performance with friends across different seasons.
This endpoint requires JWT. Pass the token via the SDK call argument jwt="YOUR_JWT".
Python Example
from OpenMLBB import OpenMLBB
client = OpenMLBB()
response = client.user.friends(jwt="YOUR_JWT", sid=1, lang="en")
print(response)
Path and Query Parameters
| Name | In | Type | Required | Default |
|---|---|---|---|---|
| sid | query | integer | yes | - |
| lang | query | string | no | en |