Many modern websites use Next.js and Server-side Rendering (SSR) to serve their website and the data to populate it. Instead of standard API calls, this manifests in the browser as calls routed through dynamic endpoints.
This val handles the url construction and response parsing, giving you access to the endpoint and data.
google.com
or val.town
let getNextSSR: (websiteUrl: string) => Promise<(endpoint: string) => Promise<Record<string, any>>>results.json
or trending.json?page=2
const fetch = await @rlesser.getNextSSR("example.com");
const data = fetch("results.json");
return data;
Migrated from folder: utils/getNextSSR