DS DevShelfHub Projects · AI tools
Tutorials / Firecrawl / Installation
Firecrawl Beginner · 6 min read Page 3 of 10

Installation and Setup

Install the SDK, configure your API key, and run your first scrape in five minutes.

By DevShelfHub

Series progress 3 / 10
Firecrawl installation tutorial — Installation and Setup

Install the Python SDK

Install the Firecrawl Python package from PyPI.

bash
pip3 install firecrawl-py

Get an API key

To use Firecrawl, you need an API key. The free tier gives you 500 credits/month — enough to try it out.

1. Go to firecrawl.dev and sign up

2. Navigate to Dashboard → API Keys

3. Copy your API key (starts with fc-)

4. Keep it safe — don't commit it to git

Configure environment variables

Store your API key in an environment variable for safety.

Create a .env file in your project root:

FIRECRAWL_API_KEY=fc-your-api-key-here

Load it with python-dotenv:

pip3 install python-dotenv
# Then in your script:
from dotenv import load_dotenv
load_dotenv()
api_key = os.environ.get("FIRECRAWL_API_KEY")

First scrape: Hello World

Now let's scrape your first page. Run this script.

python
import os
from firecrawl import FirecrawlApp

app = FirecrawlApp(api_key=os.environ.get("FIRECRAWL_API_KEY"))

result = app.scrape_url("https://example.com")
print(result["markdown"])

You should see clean Markdown content of the page printed to your terminal.

Understanding the response

The scrape_url() response is a dictionary with these keys:

markdown

Clean Markdown version of the page content. This is usually what you want for LLMs.

html

Raw HTML (if requested). Useful for debugging or custom parsing.

links

All hyperlinks found on the page, sorted and deduplicated.

metadata

Page title, description, URL, and other metadata.

Common setup errors and fixes

401 Unauthorized

Cause: Invalid or missing API key. Fix: Check your FIRECRAWL_API_KEY environment variable is set correctly.

429 Too Many Requests

Cause: Rate limit exceeded. Fix: Add time.sleep(2) between requests or check your credit balance.

ModuleNotFoundError: No module named 'firecrawl'

Cause: Package not installed. Fix: Run pip3 install firecrawl-py in your virtual environment.

You're ready

You've installed Firecrawl and successfully scraped a page. Next, we'll dive deeper into scraping options and data extraction.

Development environment tips

A clean development setup prevents most Firecrawl issues. Use a Python virtual environment to isolate dependencies, store your API key in a .env file (never hardcode it), and start with the hosted API before considering self-hosting. The hosted version handles browser management, proxy rotation, and scaling — you only need to write the extraction logic.

For production projects, consider setting up a dedicated scraping module in your codebase. Keep Firecrawl calls behind a thin abstraction layer so you can add caching (avoid re-scraping URLs you have already processed), implement retry logic with exponential backoff, and log results for debugging. This pattern works especially well when building data pipelines that feed into AI applications — whether you are populating a RAG vector database or collecting examples for LLM fine-tuning.

Firecrawl Installation FAQ

How do I install the Firecrawl SDK?

Run pip install firecrawl-py in your terminal. The package supports Python 3.8 and above and includes all required dependencies.

Where do I get a Firecrawl API key?

Sign up at firecrawl.dev and navigate to the API Keys section in your dashboard. The free tier includes 500 credits per month to get started.

Can I self-host Firecrawl?

Yes. Firecrawl is open source. Clone the repository from GitHub and run it with Docker. Self-hosting removes rate limits and keeps your data on your own infrastructure.

Does Firecrawl work with Node.js?

Yes. Firecrawl offers both Python and Node.js SDKs. Install the Node version with npm install @mendable/firecrawl-js.

How do I test that my setup works?

After installing, run a simple scrape on any public URL. If you get clean Markdown output, your API key and SDK are configured correctly.

Continue learning with our basic scraping tutorial and how Firecrawl works.