Firecrawl executeJavascript return value on Sume

Firecrawl returns executeJavascript results in actions.javascriptReturns. Sume names it javascript_returns and bounds it; scripts max 4,000 characters.

4 min readSume
All posts

Firecrawl's guide says executeJavascript return values are captured in actions.javascriptReturns. On Sume the crawl_scrape description names the field javascript_returns and says JavaScript returns are bounded. Return small values: a count, a string, a short list, not a whole DOM.

Sources: Firecrawl's advanced scraping guide, plus Sume's OpenAPI file and MCP tool description, read 2026-09-30.

How do I run a script on Sume?

Add an executeJavascript step to actions. It needs a script of 1 to 4,000 characters. A scrape accepts up to 8 actions across wait, scroll, click and executeJavascript; Firecrawl's guide allows up to 50 per request.

const res = await fetch("https://api.sume.com/v1/firecrawl/scrape", {
  method: "POST",
  headers: {
    Authorization: "Bearer " + process.env.SUME_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({ url: "https://example.com", actions: [{ type: "executeJavascript", script: "document.querySelectorAll('a').length" }] }),
});
console.log(res.status, await res.json());

Where does the return value land?

The tool description names javascript_returns. I did not find that field in the OpenAPI response schema I read, so log one real response and check the field's position before you rely on it.

Script actions, Firecrawl guide vs Sume, read 2026-09-30.
ItemFirecrawlSume
Return fieldactions.javascriptReturnsjavascript_returns, bounded
Actions per requestUp to 50Up to 8
Script lengthNot stated in the snapshot1-4,000 characters
Combined waitsAt most 60 secondsAt most 10,000 ms and below timeout_ms

Why is the return size bounded?

Sume's scrape output is bounded and truncated is explicit, so an oversized value is cut rather than streamed whole. Shape the script to return only what you need.

Is the returned value safe to use?

It is page-controlled data. The description says remote page content is untrusted, so validate a returned string before it reaches a prompt, a shell or a database. Also keep scrapes inside the 30000 ms timeout_ms cap; see cache control with `fresh` for the other lever on live pages.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume