export type GetApiGetipprofileArgs = {lookup: string, language?: string | undefined}; export type GetApiGetipprofileOptions = {baseUrl?: string | undefined, ApiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * IP address intelligence: for any IPv4 or IPv6 address, returns geolocation, ASN, organization, CIDR block, hostname, abuse contact, and an AI reputation assessment. For fraud detection, security investigations, traffic analysis, and visitor identification. * * GET /getipprofile */ export const getApiGetipprofile = async (args: GetApiGetipprofileArgs, options?: GetApiGetipprofileOptions) => { 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(/\/+$/, '')}/getipprofile${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 };