Skip to content

Add support for local/custom API URLs - #20

Merged
abimaelmartell merged 4 commits into
mainfrom
feat/local-api-support
Jan 31, 2026
Merged

abimaelmartell merged 4 commits into
mainfrom
feat/local-api-support

Conversation

@abimaelmartell

Copy link
Copy Markdown
Member

Summary

  • Skip API key requirement when using custom (non-cloud) API URLs
  • Allow optional API key input during login for custom URLs
  • Skip browser auth flow for custom URLs (go straight to manual entry)

Problem

Users running Firecrawl locally via Docker with USE_DB_AUTHENTICATION=false couldn't use the CLI:

firecrawl login --api-url http://localhost:3002
# Would prompt for API key, then fail with "Unauthorized: Invalid token"

Solution

Detect when --api-url is different from https://api.firecrawl.dev and:

  1. Make API key optional during login
  2. Skip API key validation in validateConfig()

Usage

# Configure for local API
firecrawl login --api-url http://localhost:3002
# Press Enter to skip API key

# Now works
firecrawl scrape https://example.com

Test plan

  • Unit tests added for isCustomApiUrl() and validateConfig() with custom URLs
  • Manual test with local Firecrawl instance

🤖 Generated with Claude Code

abimaelmartell and others added 4 commits January 30, 2026 16:29
For custom API URLs (e.g., local development with Docker), the CLI now:
- Skips API key requirement when using non-cloud URLs
- Allows optional API key input during login
- Skips browser auth flow for custom URLs

This enables use with local Firecrawl instances that have
USE_DB_AUTHENTICATION=false.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add --api-url flag at both global and command levels (scrape, crawl,
map, search, credit-usage) similar to --api-key. When a custom API URL
is provided, authentication is skipped allowing requests to local or
self-hosted Firecrawl instances without an API key.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Document the --api-url option for self-hosted and local development
use cases in the README, including examples for environment variables
and CI/CD usage.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@abimaelmartell
abimaelmartell merged commit 8845a2f into main Jan 31, 2026
1 check passed
@abimaelmartell
abimaelmartell deleted the feat/local-api-support branch January 31, 2026 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant