Integration

Use browser.city with LangChain (RAG + agents)

Fetch clean markdown with the Request API, then feed it into LangChain documents and pipelines. Use Sessions/Humanized REST only when interaction is required.

Most LangChain pipelines start the same way: get reliable content, then split, embed, and store it.

browser.city’s Request API is the fastest path for that first step: it renders pages and returns clean markdown in one call.

If a site needs interaction (auth, clicking, multi-step flows), use Sessions (Playwright) or Humanized REST (/v1/do/*) and only fall back to extraction when you have the state you need.

1) URL -> markdown (Request API)

request.ts
const apiKey = process.env.BROWSERCITY_API_KEY!;const opts = { method: "POST", headers: { Authorization: `Bearer ${apiKey}` } };const res = await fetch("https://api.browser.city/v1/requests", {  ...opts,  body: JSON.stringify({ url: "https://example.com", markdown: true }),}).then((r) => r.json());console.log(res.content);

2) Create documents (LangChain + generic)

langchain.ts
import { Document } from "@langchain/core/documents";const doc = new Document({  pageContent: res.content,  metadata: {    source: res.url,    contentType: res.contentType,    status: res.status,  },});

From here:

  • split markdown into chunks (character or token-based)
  • embed and store in your vector DB
  • run retrieval + generation on demand

What to use when

  • Use Request API for 90% of ingestion (fast, simple, cheap).
  • Use Sessions when you need real browser state and deterministic automation.
  • Use Humanized REST when you want interactive steps but don’t want to run Playwright in your runtime.
[ 06 / 06 ] — Get Started

Start building in under a minute

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