Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/firecrawl/firecrawl/llms.txt

Use this file to discover all available pages before exploring further.

Authentication

The Firecrawl API uses API keys to authenticate requests. All API requests must include your API key in the Authorization header.

Getting Your API Key

1

Create an Account

Sign up for a free account at firecrawl.dev.
2

Access Your Dashboard

After signing up, log in to your dashboard.
3

Generate an API Key

Navigate to the API Keys section in your dashboard and click “Create New API Key”.
4

Copy and Store Securely

Copy your API key immediately. It will start with fc- followed by a unique string.
Keep your API key secure! Your API key carries many privileges, so be sure to keep it secure. Do not share your secret API key in publicly accessible areas such as GitHub, client-side code, or any other public forums.

Using Your API Key

All API requests must include your API key in the Authorization header as a Bearer token:
Authorization: Bearer fc-YOUR_API_KEY

REST API

Include the Authorization header in all API requests:
curl -X POST 'https://api.firecrawl.dev/v2/scrape' \
  -H 'Authorization: Bearer fc-YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{"url": "https://example.com"}'

Python SDK

You can pass your API key directly to the SDK or use an environment variable:
from firecrawl import Firecrawl

app = Firecrawl(api_key="fc-YOUR_API_KEY")

doc = app.scrape("https://firecrawl.dev", formats=["markdown"])

JavaScript/Node.js SDK

Similar to Python, you can pass the API key directly or use an environment variable:
import Firecrawl from '@mendable/firecrawl-js';

const app = new Firecrawl({ apiKey: 'fc-YOUR_API_KEY' });

const doc = await app.scrape('https://firecrawl.dev', { formats: ['markdown'] });

Environment Variables

It’s recommended to store your API key in environment variables rather than hardcoding it in your application:
Create a .env file in your project root:
FIRECRAWL_API_KEY=fc-YOUR_API_KEY
Python: Use python-dotenv to load environment variables:
from dotenv import load_dotenv
from firecrawl import Firecrawl

load_dotenv()
app = Firecrawl()  # Automatically uses FIRECRAWL_API_KEY from .env
JavaScript: Use dotenv package:
import 'dotenv/config';
import Firecrawl from '@mendable/firecrawl-js';

const app = new Firecrawl();  // Automatically uses FIRECRAWL_API_KEY from .env
Add .env to your .gitignore file to prevent committing your API key to version control:
# .gitignore
.env

API Key Best Practices

Never Hardcode

Don’t hardcode API keys in your source code. Always use environment variables or secret management systems.

Rotate Regularly

Regularly rotate your API keys, especially if you suspect they may have been compromised.

Use Different Keys

Use different API keys for development, staging, and production environments.

Monitor Usage

Monitor your API usage in the dashboard to detect any unusual activity.

Rate Limits

API keys are subject to rate limits based on your plan. The current rate limit information is included in the response headers:
X-RateLimit-Limit: 100
X-RateLimit-Remaining: 95
X-RateLimit-Reset: 1640995200
If you exceed your rate limit, you’ll receive a 429 Too Many Requests response. The X-RateLimit-Reset header indicates when your rate limit will reset (as a Unix timestamp).

Checking Credit Usage

You can check your remaining credits using the API:
curl -X GET 'https://api.firecrawl.dev/v1/team/credit-usage' \
  -H 'Authorization: Bearer fc-YOUR_API_KEY'

Troubleshooting

Invalid API Key

If you receive a 401 Unauthorized error, check that:
  1. Your API key is correct and starts with fc-
  2. The API key is included in the Authorization header as Bearer fc-YOUR_API_KEY
  3. Your API key hasn’t been revoked or expired

Missing Authorization Header

If you receive an error about a missing authorization header:
{
  "error": "Missing Authorization header"
}
Ensure you’re including the Authorization header in your request:
-H 'Authorization: Bearer fc-YOUR_API_KEY'

Payment Required

If you receive a 402 Payment Required error, you’ve exhausted your credits. Upgrade your plan or purchase additional credits in the dashboard.

Managing Multiple API Keys

You can create multiple API keys for different purposes:
  • Development: For local development and testing
  • Staging: For pre-production environments
  • Production: For live applications
  • CI/CD: For automated testing and deployments
To create additional API keys, go to your dashboard and click “Create New API Key”. You can name each key and revoke them individually if needed.

Revoking API Keys

If an API key is compromised or no longer needed:
1

Go to Dashboard

Navigate to the API Keys section in your dashboard.
2

Find the Key

Locate the API key you want to revoke.
3

Revoke

Click the “Revoke” button next to the key.
4

Confirm

Confirm the revocation. This action cannot be undone.
Revoking an API key immediately invalidates it. Any applications using that key will stop working until you update them with a new key.

Next Steps

Quickstart

Start making API requests with your new API key

API Reference

Explore all available endpoints

SDKs

Learn more about our official SDKs

Pricing

View plans and pricing