Back

Version 36

2/28/2023
espntcFindGroups = async (
options: {
search?: string,
access?: "all" | "public" | "private",
type?: "all" | "celebrity" | "fans",
locked?: "all" | "unlocked" | "locked",
dropWorst?: boolean,
start?: number,
num?: number,
} = {}
) => {
const baseURL =
"https://fantasy.espncdn.com/tournament-challenge-bracket/2023/en/api/findGroups";

const params: any = { ...options };
if (params.access)
params.access = ["all", "public", "private"].indexOf(params.access);
if (params.type)
params.access = ["all", "celebrity", "fans"].indexOf(params.type);
if (params.locked)
params.locked = ["all", "unlocked", "locked"].indexOf(params.locked);

const res = await @stevekrouse.fetchJSON(`${baseURL}?${params}`);

interface Group {private: boolean, size: number, type: 'user' | 'celebrity' | 'fans'}

return res.g.map(g => ({
[private: boolean]: g.p,
size: g.s,

}))
};
Updated: October 23, 2023