Skip to content

Quickstart with Python

The Python SDK ships as faircrawl on PyPI and includes both sync FairCrawl and async AsyncFairCrawl clients over the live FairCrawl API.

Install

Terminal window
pip install faircrawl

Sync usage

Scrape from Python

```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 }' ```

Async usage

import asyncio
from faircrawl import AsyncFairCrawl
async def main() -> None:
async with AsyncFairCrawl() as fc:
scrape_result, research_result = await asyncio.gather(
fc.scrape("https://stripe.com/pricing", format="markdown"),
fc.research(
"Claude Code vs Cursor for large codebases",
sources=["web", "reddit", "github"],
depth="default",
synthesize=True,
),
)
print(scrape_result.meta.cost)
print(research_result.stats.total_results)
asyncio.run(main())

Environment fallback

If api_key= is omitted, the SDK reads FAIRCRAWL_API_KEY from the environment automatically.

Current Python surface

  • scrape()
  • crawl()
  • map()
  • research()
  • agent()
  • interact()
  • enrich_company()
  • freshness_check()