Quickstart with curl
curl is the fastest way to validate auth, response shape, and billing metadata before you commit to an SDK integration.
1. Export your API key
export FAIRCRAWL_API_KEY=fc_live_xxx2. Scrape one page
Scrape one URL
```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
}
}
```
3. Discover URLs before crawling
Map a docs site
```bash
curl https://api.faircompany.ai/v1/crawl/map \
-X POST \
-H "Authorization: Bearer fc_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"url": "https://docs.stripe.com",
"limit": 50,
"search": "checkout"
}'
```
```ts
const map = await fc.map({
url: "https://docs.stripe.com",
limit: 50,
search: "checkout",
});
console.log(map.count);
console.log(map.urls[0]);
```
```python
map_result = fc.map(
"https://docs.stripe.com",
limit=50,
search="checkout",
)
print(map_result.count)
print(map_result.urls[0] if map_result.urls else None)
```
```json
{
"tool": "faircrawl_map",
"arguments": {
"url": "https://docs.stripe.com",
"limit": 50,
"search": "checkout"
}
}
```
4. Run a multi-source research query
Research with synthesis
```bash
curl https://api.faircompany.ai/v1/crawl/research \
-X POST \
-H "Authorization: Bearer fc_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"query": "Claude Code vs Cursor for large codebases",
"sources": ["web", "reddit", "hackernews", "github"],
"depth": "default",
"synthesize": true
}'
```
```ts
const research = await fc.research({
query: "Claude Code vs Cursor for large codebases",
sources: ["web", "reddit", "hackernews", "github"],
depth: "default",
synthesize: true,
});
console.log(research.synthesis?.summary);
console.log(research.stats);
```
```python
research = fc.research(
"Claude Code vs Cursor for large codebases",
sources=["web", "reddit", "hackernews", "github"],
depth="default",
synthesize=True,
)
print(research.synthesis.summary if research.synthesis else None)
print(research.stats.total_results)
```
```json
{
"tool": "faircrawl_research",
"arguments": {
"query": "Claude Code vs Cursor for large codebases",
"sources": ["web", "reddit", "hackernews", "github"],
"depth": "default",
"synthesize": true
}
}
```
Production notes
- send JSON bodies with
Content-Type: application/json - keep the
Authorization: Bearer ...header on every request - inspect
_meta.cost,_meta.method, and response-time fields before you benchmark throughput - keep
curlexamples around for incident response and regression repros even if your app uses an SDK