export type CreateApiSerperMapsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Google Maps search - returns map listings with titles, addresses, latitude/longitude coordinates, ratings, review counts, phone numbers, websites, and categories. More detailed than Places for location-based queries. Use ll parameter for precise geographic targeting. Pagination billing: call the first page normally and save billing.requestId from the Orthogonal /v1/run response. For later page, offset, or cursor calls on the same logical search, pass parentRequestId with unchanged non-pagination parameters. Valid continuation calls still get their own request IDs and quoted price, but are charged 0. Changing filters starts a new billable request. * * POST /serper/maps */ export const createApiSerperMaps = async (options?: CreateApiSerperMapsOptions) => { const {baseUrl = "https://mpp.orthogonal.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/serper/maps${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };