export type CreateApiBytemineCrawlResultsArgs = {body: {job_id: string, page?: number | undefined, per_page?: number | undefined}}; export type CreateApiBytemineCrawlResultsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Retrieve paginated results from a completed crawl. Each result includes URL, markdown, metadata, and links. Free, no credits. * * POST /bytemine/crawl/results */ export const createApiBytemineCrawlResults = async (args: CreateApiBytemineCrawlResultsArgs, options?: CreateApiBytemineCrawlResultsOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/bytemine/crawl/results${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };