import { getHtmlBySearchId } from "https://deno.land/x/serpapi@2.1.0/mod.ts";
Get a HTML response given a search ID.
- This search ID can be obtained from the
search_metadata.id
key in the response. - Typically used together with the
async
parameter.
Examples
const response = await getJson({ engine: "google", api_key: API_KEY, async: true, q: "coffee" });
const { id } = response.search_metadata;
await delay(1000); // wait for the request to be processed.
const response = await getJson({ engine: "google", api_key: API_KEY, async: true, q: "coffee" }); const { id } = response.search_metadata; await delay(1000); // wait for the request to be processed.
// async/await const html = await getHtmlBySearchId(id, { api_key: API_KEY });
// callback getHtmlBySearchId(id, { api_key: API_KEY }, console.log);
Parameters
optional
parameters: GetBySearchIdParameters = [UNSUPPORTED]