How to use Firecrawl through the Clickmax API
The Clickmax API calls Firecrawl to search the web and read pages, with the same Clickmax API key you use for other calls. You do not need a Firecrawl account: without a key of your own connected, Clickmax makes the call on its own account. If you prefer your Firecrawl account, connect its key to the workspace, and calls then spend the credits of your Firecrawl account.
Before you start, you need:
- a Clickmax workspace API key (see Authentication in the Clickmax API);
- only to use your own Firecrawl account: a Firecrawl API key (
fc-...), created in the Firecrawl dashboard, and permission to manage integrations in the workspace.
The Firecrawl connection exists only through the API. It does not appear on the Integrations screen.
The examples use the TypeScript SDK. Over HTTP, the paths are the same, under /api/v0/firecrawl/.
Use your own Firecrawl account (optional)
Clickmax checks the key with Firecrawl before storing it, without spending credits. A rejected key is not stored. Connecting again replaces the previous key. Each workspace has one Firecrawl key.
clickmax.firecrawl.status()tells whether a key is connected. Thebillingfield says which account calls use:own_key(your Firecrawl account) orclickmax_credits(the Clickmax account).clickmax.firecrawl.disconnect()removes the key. Later calls go back to the Clickmax account.
Search the web
The query accepts operators such as site:, -site: and quoted phrases. Without scrapeOptions, each result has only url, title and description. To also get each page's content, send scrapeOptions: { formats: ['markdown'], onlyMainContent: true }. This makes the search slower and more expensive.
Read a page
formatsacceptsmarkdownandlinks. The default is["markdown"].onlyMainContent: falsekeeps the header and footer, where phone numbers and WhatsApp links usually are.- A page that answered with an error still returns successfully. Check
data.metadata.statusCode: 400 or more means an error page. maxAge,storeInCache,blockAds,removeBase64Imagesandlocation(country,languages) follow Firecrawl's behavior.
Check your Firecrawl account balance
This call spends no credits, so it also tells you whether the connected key still works. It only works with your key connected: without one it returns firecrawl_not_connected, and searches and page reads keep working on the Clickmax account.
Timeout
timeout ranges from 1000 to 60000 milliseconds, and the default is 30000. Firecrawl stops trying when it reaches that time. Keep the Clickmax client timeout (60000 by default) above the call's timeout, so you get Firecrawl's answer instead of an SDK timeout error.
Firecrawl errors
Read the error code to decide what to do.
Clickmax does not retry Firecrawl calls on its own. The Clickmax API rate limits still apply.