Search players by team, wallet or name
const url = 'https://foxleague.ai/api/users/search';const options = {method: 'GET'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://foxleague.ai/api/users/searchAnswers up to 10 players whose team name, wallet or username contains q, ignoring case, highest ELO first. Only players with a team are listed. A q shorter than 2 characters after trimming answers an empty list.
Who: anyone.
Refusals:
Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters ”Text to look for in team names, wallets and usernames, at least 2 characters.
When true, lists only players with an active developer team and shows that team’s name and crest. Default false.
Responses
Section titled “ Responses ”Success or a refusal: read success (the refusals are in the description).
object
A machine-readable reason next to error, set only where the caller must act differently. tx_pending: the payment was not refused but could not be verified yet; keep the transaction hash and confirm again with the same hash, never pay twice.
The answer. Present when success is true.
One player found by the search.
object
The team badge; null when none. With dev_only=true, the developer team’s crest address.
ELO rating, lifetime.
User id.
The team name. With dev_only=true, the developer team’s name.
Display name; null when none.
The wallet address.
Why the request was refused, in plain words. Present when success is false.
true when the request did what it asked. false is a refusal: read error.
Example
{ "data": [ { "badge": "ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi", "elo_rating": 1688, "id": 1093, "team_name": "Red Kites", "username": null, "wallet_address": "erd124fl6zy54klay937yrnujckpak28lrdjg0eel92ue3gm36kcwf9tfwwqlt" }, { "badge": null, "elo_rating": 1402, "id": 1517, "team_name": "Kestrel FC", "username": "kestrel", "wallet_address": "erd1sjqf6h5graeeeex7ervydu284rxqfxhpydcfskh788la77n9fx4s72pdhf" } ], "success": true}