export type GetApiRocketreachCompanyLookupArgs = {name?: string | undefined, domain?: string | undefined, id?: number | undefined}; export type GetApiRocketreachCompanyLookupOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Look up a company by name, domain, or ID. Returns company profile including industry, size, location, revenue, and more. Consumes 1 export credit. * * GET /rocketreach/company/lookup/ */ export const getApiRocketreachCompanyLookup = async (args: GetApiRocketreachCompanyLookupArgs, options?: GetApiRocketreachCompanyLookupOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.name != null) query.append("name", String(args.name)) if (args.domain != null) query.append("domain", String(args.domain)) if (args.id != null) query.append("id", String(args.id)) const url = `${baseUrl.replace(/\/+$/, '')}/rocketreach/company/lookup/${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 };