export type GetApiIcypeasApiScrapeProfileArgs = {url: string}; export type GetApiIcypeasApiScrapeProfileOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Scrape a LinkedIn user profile by URL. Returns detailed profile data including work experience, education, skills, languages, and contact info. * * GET /icypeas/api/scrape/profile */ export const getApiIcypeasApiScrapeProfile = async (args: GetApiIcypeasApiScrapeProfileArgs, options?: GetApiIcypeasApiScrapeProfileOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.url != null) query.append("url", String(args.url)) const url = `${baseUrl.replace(/\/+$/, '')}/icypeas/api/scrape/profile${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 };