export type GetApiGetuserxhandleArgs = {lookup: string, language?: string | undefined}; export type GetApiGetuserxhandleOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * X (Twitter) handle lookup: finds the X handle for a person, company, sports team, government entity, or descriptive phrase (for example 'sf 49ers' to @49ers), with a confidence score. For social media enrichment, influencer and brand research, and contact enrichment. * * GET /getuserxhandle */ export const getApiGetuserxhandle = async (args: GetApiGetuserxhandleArgs, options?: GetApiGetuserxhandleOptions) => { const {baseUrl = "https://api.interzoid.com", fetch: fetchFn = fetch, ApiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/json") if (args.lookup != null) query.append("lookup", String(args.lookup)) if (args.language != null) query.append("language", String(args.language)) if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/getuserxhandle${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 (await res.json()) as unknown };