Skip to content

Quickstart with TypeScript

The TypeScript SDK is the primary first-party client surface for FairCrawl. It wraps the live crawl routes without inventing a second abstraction layer.

Install

Terminal window
npm install faircrawl
# or
pnpm add faircrawl
# or
bun add faircrawl

Create a client

import FairCrawl from "faircrawl";
const fc = new FairCrawl({
apiKey: process.env.FAIRCRAWL_API_KEY || "fc_live_xxx",
baseUrl: "https://api.faircompany.ai/v1",
timeoutMs: 75_000,
});

Make three core calls

Scrape from TypeScript

```bash curl https://api.faircompany.ai/v1/crawl/web/scrape \ -X POST \ -H "Authorization: Bearer fc_live_xxx" \ -H "Content-Type: application/json" \ -d '{ "url": "https://stripe.com/pricing", "format": "markdown", "only_main_content": true }' ```
const map = await fc.map({
url: "https://docs.stripe.com",
limit: 50,
search: "checkout",
});
const research = await fc.research({
query: "Claude Code vs Cursor for large codebases",
sources: ["web", "reddit", "hackernews", "github"],
depth: "default",
synthesize: true,
});

Runtime support

  • Node 20+
  • Bun
  • Deno
  • browser and edge runtimes that provide native fetch
  • /docs/endpoints/scrape/overview/ if your app reads single pages
  • /docs/endpoints/interact/overview/ if your targets need browser automation
  • /docs/sdks/typescript/ for the full SDK surface