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
pip install faircrawlSync 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
}'
```
```ts
import FairCrawl from "faircrawl";
const fc = new FairCrawl({ apiKey: process.env.FAIRCRAWL_API_KEY || "fc_live_xxx" });
const result = await fc.scrape({
url: "https://stripe.com/pricing",
format: "markdown",
only_main_content: true,
});
console.log(result.text);
console.log(result._meta.cost);
```
```python
from faircrawl import FairCrawl
fc = FairCrawl()
result = fc.scrape(
"https://stripe.com/pricing",
format="markdown",
only_main_content=True,
)
print(result.text)
print(result.meta.cost)
```
```json
{
"tool": "faircrawl_scrape",
"arguments": {
"url": "https://stripe.com/pricing",
"format": "markdown",
"only_main_content": true
}
}
```
Async usage
import asynciofrom 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()