Skip to main content

Prerequisites

  • Node.js 18+, Bun, or Deno
  • A EvoCrawl API key — get one free

Setup

npm install hono @mendable/evocrawl-js
Add your API key to .env:
EVOCRAWL_API_KEY=fc-YOUR-API-KEY

Search the web

import { Hono } from "hono";
import Evocrawl from "@mendable/evocrawl-js";

const app = new Hono();
const evocrawl = new Evocrawl({ apiKey: process.env.EVOCRAWL_API_KEY });

app.post("/search", async (c) => {
  const { query } = await c.req.json();
  const results = await evocrawl.search(query, { limit: 5 });
  return c.json(results);
});

export default app;

Scrape a page

app.post("/scrape", async (c) => {
  const { url } = await c.req.json();
  const result = await evocrawl.scrape(url);
  return c.json(result);
});

Interact with a page

Use interact to control a live browser session — click buttons, fill forms, and extract dynamic content.
app.post("/interact", async (c) => {
  const { url } = await c.req.json();

  const result = await evocrawl.scrape(url, { formats: ['markdown'] });
  const scrapeId = result.metadata?.scrapeId;

  await evocrawl.interact(scrapeId, { prompt: 'Search for iPhone 16 Pro Max' });
  const response = await evocrawl.interact(scrapeId, { prompt: 'Click on the first result and tell me the price' });

  await evocrawl.stopInteraction(scrapeId);

  return c.json({ output: response.output });
});

Deploy anywhere

Hono runs on multiple runtimes. For Cloudflare Workers, pass the API key from the environment binding:
import { Hono } from "hono";
import Evocrawl from "@mendable/evocrawl-js";

type Bindings = { EVOCRAWL_API_KEY: string };
const app = new Hono<{ Bindings: Bindings }>();

app.post("/search", async (c) => {
  const evocrawl = new Evocrawl({ apiKey: c.env.EVOCRAWL_API_KEY });
  const { query } = await c.req.json();
  const results = await evocrawl.search(query, { limit: 5 });
  return c.json(results);
});

export default app;

Next steps

Scrape docs

All scrape options including formats, actions, and proxies

Search docs

Search the web and get full page content

Interact docs

Click, fill forms, and extract dynamic content

Node SDK reference

Full SDK reference with crawl, map, batch scrape, and more