Giriş
Web scraping işlemlerini local bilgisayarınızda gerçekleştirmek için opensource olarak yayınlanan Firecrawl'ı kullanabilirsiniz. İşte nasıl kuracağınıza dair hızlı bir örnek.
Docker Desktop Kurulumu
Öncelikle bilgisayarınıza Docker Desktop'u kurun. → https://www.docker.com/products/docker-desktop/
Firecrawl Kodunu İndirme
Firecralw kodunu bilgisayarınıza indirin.
#Uygun bir lokasyona cd ile gittikten sonra
mkdirs firecrawl-docker
cd firecrawl-docker
git clone https://github.com/mendableai/firecrawl.git
cd firecrawl/apps/api/
Ortam Değişkenleri (.env) Ayarları
Bu klasörde (firecrawl/apps/api/
) bulunan env.example
dosyasını favori editörünüz ile açın ve aşağıdaki gibi değiştirin. Sonrasında bu dosyayı .env
olarak farklı kaydedin.
# ===== Required ENVS ======
NUM_WORKERS_PER_QUEUE=8
PORT=3002
HOST=0.0.0.0
REDIS_URL=redis://localhost:6379
REDIS_RATE_LIMIT_URL=redis://localhost:6379
PLAYWRIGHT_MICROSERVICE_URL=http://playwright-service:3000/html
## To turn on DB authentication, you need to set up supabase.
USE_DB_AUTHENTICATION=false
# ===== Optional ENVS ======
# SearchApi key. Head to https://searchapi.com/ to get your API key
SEARCHAPI_API_KEY=
# SearchApi engine, defaults to google. Available options: google, bing, baidu, google_news, etc. Head to https://searchapi.com/ to explore more engines
SEARCHAPI_ENGINE=
# Supabase Setup (used to support DB authentication, advanced logging, etc.)
SUPABASE_ANON_TOKEN=
SUPABASE_URL=
SUPABASE_SERVICE_TOKEN=
# Other Optionals
# use if you've set up authentication and want to test with a real API key
TEST_API_KEY=
# set if you'd like to test the scraping rate limit
RATE_LIMIT_TEST_API_KEY_SCRAPE=
# set if you'd like to test the crawling rate limit
RATE_LIMIT_TEST_API_KEY_CRAWL=
# set if you'd like to use scraping Be to handle JS blocking
SCRAPING_BEE_API_KEY=
# add for LLM dependednt features (image alt generation, etc.)
OPENAI_API_KEY=
BULL_AUTH_KEY=@
# set if you have a llamaparse key you'd like to use to parse pdfs
LLAMAPARSE_API_KEY=
# set if you'd like to send slack server health status messages
SLACK_WEBHOOK_URL=
# set if you'd like to send posthog events like job logs
POSTHOG_API_KEY=
# set if you'd like to send posthog events like job logs
POSTHOG_HOST=
STRIPE_PRICE_ID_STANDARD=
STRIPE_PRICE_ID_SCALE=
STRIPE_PRICE_ID_STARTER=
STRIPE_PRICE_ID_HOBBY=
STRIPE_PRICE_ID_HOBBY_YEARLY=
STRIPE_PRICE_ID_STANDARD_NEW=
STRIPE_PRICE_ID_STANDARD_NEW_YEARLY=
STRIPE_PRICE_ID_GROWTH=
STRIPE_PRICE_ID_GROWTH_YEARLY=
# set if you'd like to use the fire engine closed beta
FIRE_ENGINE_BETA_URL=
# Proxy Settings for Playwright (Alternative you can can use a proxy service like oxylabs, which rotates IPs for you on every request)
PROXY_SERVER=
PROXY_USERNAME=
PROXY_PASSWORD=
# set if you'd like to block media requests to save proxy bandwidth
BLOCK_MEDIA=
# Set this to the URL of your webhook when using the self-hosted version of FireCrawl
SELF_HOSTED_WEBHOOK_URL=
# Resend API Key for transactional emails
RESEND_API_KEY=
# LOGGING_LEVEL determines the verbosity of logs that the system will output.
# Available levels are:
# NONE - No logs will be output.
# ERROR - For logging error messages that indicate a failure in a specific operation.
# WARN - For logging potentially harmful situations that are not necessarily errors.
# INFO - For logging informational messages that highlight the progress of the application.
# DEBUG - For logging detailed information on the flow through the system, primarily used for debugging.
# TRACE - For logging more detailed information than the DEBUG level.
# Set LOGGING_LEVEL to one of the above options to control logging output.
LOGGING_LEVEL=INFO
Firecrawl'u Çalıştırma
Terminalde firecrawl/apps/api/
yolunda olduğunuza emin olun.
Ayrıca Docker Desktop programının da açık olduğuna emin olun. (Bu aynı zamanda docker engine'nin çalıştığına emin olun demek!)
Ve sihirli komut…
docker compose up -d
Komutun işini bitirmesini bekleyin ve firecrawl localinizde çalışır halde.
Test Etme
Denemek için bir browser açın ve aşağıdaki url'e gidin.
http://localhost:3002/test
Karşınıza aşağıdaki gibi bir sonuç çıkarsa işlem başarılı demektir.
Hello, world!
Sonuç
Artık firecrawl tarafından sunulan hizmetleri bilgisayarınızda kullanabilirsiniz. İyi kazımalar 😀