Skip to main content

FastAPI

Use Firecrawl with FastAPI to build async web scraping and search APIs in Python.
1 min read

Prerequisites#

Setup#

Add your API key to .env:

Create the API#

Create main.py:

Run it#

Test it#

FastAPI auto-generates interactive docs at http://localhost:8000/docs.

Async variant#

For better concurrency under load, use AsyncFirecrawl:

Next steps#