Integration

Use browser.city with CrewAI (tools + browsing)

Give CrewAI agents a fast web-reading tool via the Request API, and use Humanized REST (/v1/do/*) when interaction is required.

CrewAI agents work best when tools are:

  • deterministic (same input -> same output)
  • fast (low latency, low glue code)
  • safe (minimal data retention; avoid logging page content by default)

browser.city gives you two good “tool shapes”:

  • Request API: one call to turn a URL into markdown
  • Humanized REST (/v1/do/*): interactive steps over HTTP (open, navigate, click, type, markdown) without running Playwright

1) Tool: URL -> markdown (Request API)

Define a tool that returns markdown for any URL:

tools.ts
const apiKey = process.env.BROWSERCITY_API_KEY!;const opts = { method: "POST", headers: { Authorization: `Bearer ${apiKey}` } };export async function browsercityMarkdown(url: string): Promise<string> {  const res = await fetch("https://api.browser.city/v1/requests", {    ...opts,    body: JSON.stringify({ url, markdown: true }),  }).then((r) => r.json());  return res.content as string;}

Wire this function into your CrewAI agent as a tool (exact wiring depends on your CrewAI version).

2) Tool: interactive browse -> markdown (Humanized REST)

When a site needs state (cookies) or interaction (click/type), use /v1/do/* as a tool.

browse.ts
const apiKey = process.env.BROWSERCITY_API_KEY!;const opts = { method: "POST", headers: { Authorization: `Bearer ${apiKey}` } };export async function browsercityBrowseMarkdown(url: string): Promise<string> {  const open = await fetch("https://api.browser.city/v1/do/open", {    ...opts,    body: JSON.stringify({ browser: "chromium" }),  }).then((r) => r.json());  const sessionId = open.result as string;  await fetch("https://api.browser.city/v1/do/navigate", {    ...opts,    body: JSON.stringify({ sessionId, url }),  });  const md = await fetch("https://api.browser.city/v1/do/markdown", {    ...opts,    body: JSON.stringify({ sessionId }),  }).then((r) => r.json());  return md.result as string;}

What to use when

  • Default to Request API for reading pages at scale (cheap and simple).
  • Use Humanized REST when you need click/type/navigation without running Playwright.
  • Use Sessions API for long-running, production-grade workflows you want to own in Playwright.
[ 06 / 06 ] — Get Started

Start building in under a minute

Free tier. No credit card. Full stealth from day one.