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
export async function browsercityMarkdown(url: string): Promise<string> {  const res = await fetch("https://api.browser.city/v1/requests", {    method: "POST",    headers: { Authorization: `Bearer ${process.env.BROWSERCITY_API_KEY}`, "Content-Type": "application/json" },    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 doUrl = (action: string) => `https://api.browser.city/v1/do/${action}`;const doAction = (action: string, body: unknown) =>  fetch(doUrl(action), {    method: 'POST',    headers: { Authorization: `Bearer ${process.env.BROWSERCITY_API_KEY}`, 'Content-Type': 'application/json' },    body: JSON.stringify(body),  }).then((r) => r.json());export async function browse(url: string) {  const opened = await doAction('open', { browser: 'chromium' });  try {    await doAction('navigate', { sessionId: opened.sessionId, url });    const page = await doAction('markdown', { sessionId: opened.sessionId });    return page.result;  } finally {    await doAction('close', { sessionId: opened.sessionId });  }}

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

Give your AI agents the web.

Start for free. No credit card required. Private sessions by default.