SDKs
SDKs
Copy page
Use the official Firecrawl SDKs with DarkCrawl by changing only the base URL.
Firecrawl SDK compatible
DarkCrawl speaks a subset of the Firecrawl v2 API. The official Firecrawl SDKs work with it when you change only the base URL: your code, your calls and your options stay as they are.
# pip install firecrawl
import os
from firecrawl import Firecrawl
firecrawl = Firecrawl(
api_key=os.environ["DARKCRAWL_API_KEY"],
api_url="https://api.darkcrawl.dev",
)
doc = firecrawl.scrape("http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/notice", formats=["markdown"])
print(doc.markdown)// npm install firecrawl
import { Firecrawl } from 'firecrawl';
const firecrawl = new Firecrawl({
apiKey: process.env.DARKCRAWL_API_KEY,
apiUrl: 'https://api.darkcrawl.dev',
});
const doc = await firecrawl.scrape('http://exampleonionq7x2mfk4lzr5w3ty6hbnc2jdu7avs4ekp5gw3xmlq2zr.onion/notice', { formats: ['markdown'] });
console.log(doc.markdown);The samples read your key from DARKCRAWL_API_KEY. The base URL of the hosted API is https://api.darkcrawl.dev.
Choose a page
Section titled “Choose a page”- Python: the
firecrawlpackage. - Node: the
firecrawlpackage for JavaScript. - Plain HTTP: any client that can send JSON.
What works
Section titled “What works”DarkCrawl’s tests run both SDKs through scrape, crawl, start crawl, status with paging through next, cancel, map, every /v2/monitor call and the agent calls. Parse works from both. Each SDK’s page lists what it drops or sends for you.
What does not
Section titled “What does not”- Endpoints. DarkCrawl has
/v2/scrape,/v2/crawl,/v2/batch/scrape,/v2/map,/v2/search,/v2/parse,/v2/monitorand/v2/agent. The agent’s list, trace, skill and snapshot routes, browser sessions, usage and credits, and the whole v1 API are not implemented and answer404. - Extract.
/v2/extractanswers501 NOT_IMPLEMENTED: Firecrawl deprecated it. Use the agent, which does its work. - Formats.
branding,menuanddeterministicJsonanswer400 NOT_IMPLEMENTED. - Browser options.
actionsanswers400 NOT_IMPLEMENTED. - The open web. Clear-web URLs are refused,
CookieandAuthorizationheaders are not available, and search answers from onion services only. - Credits.
creditsUsedis always 0.
Options DarkCrawl ignores are accepted and named in a warning, so an SDK call does not fail on shape. A field Firecrawl does not have is 400 BAD_REQUEST.
Every request goes over Tor, so allow more time than for the open web. Working with onion sites says what to expect.