Public
Back
Version 92
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: 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 || 0,
num: options?.num || 30,
};
console.log(`${baseURL}?${new URLSearchParams(params)}`);
const res = await stevekrouse.fetchJSON(
`${baseURL}?${new URLSearchParams(params)}`
);
interface Group {
id: number;
name: string;
motto: string;
size: number;
private: boolean;
locked: boolean;
type: "user" | "celebrity" | "fans";
Updated: October 23, 2023