export type GetApiScrapecreatorsV1TiktokSongArgs = {clipId: string}; export type GetApiScrapecreatorsV1TiktokSongOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get Song Details * * GET /scrapecreators/v1/tiktok/song */ export const getApiScrapecreatorsV1TiktokSong = async (args: GetApiScrapecreatorsV1TiktokSongArgs, options?: GetApiScrapecreatorsV1TiktokSongOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.clipId != null) query.append("clipId", String(args.clipId)) const url = `${baseUrl.replace(/\/+$/, '')}/scrapecreators/v1/tiktok/song${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };