agentic icon indicating copy to clipboard operation
agentic copied to clipboard

FireCrawl: SearchResponse type is not aligned with FireCrawl API response

Open mjakl opened this issue 5 months ago • 1 comments

When using the scrapeUrl tool, I get back a ScrapeResponse type:

  export interface ScrapeResponse<
    LLMResult = any,
    ActionsSchema extends ActionsResult | never = never
  > extends Document<LLMResult, ActionsSchema> {
    success: true
    warning?: string
    error?: string
  }

Yet, the server responds with data similar to SearchResponse - see their documentation:

  export interface SearchResponse {
    success: boolean
    data: Document[] // <---- scraping has just a single document here, no array
    warning?: string
    error?: string
  }

That's how I called the tool:

 const scrapedData = await firecrawl.scrapeUrl({
      url,
      formats: ["markdown"],
    });

Current workaround do access the Markdown, I need to access scrapedData.data.markdown which is not allowed by the type system (the typy system would support scrapeData.markdown, but this does not exist).

mjakl avatar Jun 25 '25 18:06 mjakl

Hi @mjakl thank you for expressing this issue. I'll be helping this project out, but just getting ramped up. Here just leaving a comment that I hear you and will return shortly to address this issue fully 🙏

stevepeak avatar Sep 22 '25 15:09 stevepeak