Skip to main content
Module

x/serpapi/mod.ts>getHtml

Scrape and parse search engine results using SerpApi.
Go to Latest
function getHtml
import { getHtml } from "https://deno.land/x/serpapi@0.0.12/mod.ts";

Get a HTML response based on search parameters.

  • Accepts an optional callback.
  • Responds with a JSON string if the search request hasn't completed.

Examples

// async/await const html = await getHtml("google", { api_key: API_KEY, q: "coffee" });

// callback getHtml("google", { api_key: API_KEY, q: "coffee" }, console.log);

Type Parameters

E extends keyof EngineMap

Parameters

engine: E
  • engine name
parameters: EngineMap[E]["parameters"]
  • search query parameters for the engine
optional
callback: (html: string) => void
  • optional callback