export type GetApiGetxuserprofileArgs = {handle: string}; export type GetApiGetxuserprofileOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * X (Twitter) profile lookup: for a handle, returns the display name, bio, follower and following counts, post count, website URL, location, and account creation date. For influencer research, social listening, audience analysis, and account verification. * * GET /getxuserprofile */ export const getApiGetxuserprofile = async (args: GetApiGetxuserprofileArgs, options?: GetApiGetxuserprofileOptions) => { 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.handle != null) query.append("handle", String(args.handle)) if (ApiKeyAuth !== undefined) headers.set("x-api-key", ApiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/getxuserprofile${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 };