Public
Back
Version 83
3/6/2023
export espntcFindGroups = async (options: {
search?: string,
access?: "all" | "private" | "public",
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: {
search: string,
type_access: number,
type_group: number,
type_lock: number,
type_dropWorst?: number,
start: number,
num: number,
} = {
search: options.search,
type_access: ["all", "private", "public"].indexOf(options.access ?? "all"),
type_group: ["all", "celebrity", "fans"].indexOf(options.type ?? "all"),
type_lock: ["all", "unlocked", "locked"].indexOf(options.locked ?? "all"),
type_dropWorst: options.dropWorst ? 1 : 0,
start: options.start,
num: options.num,
};
console.log(`${baseURL}?${new URLSearchParams(params)}`);
const res = await stevekrouse.fetchJSON(
`${baseURL}?${new URLSearchParams(params)}`
);
Updated: October 23, 2023