send 'markdown' format request to firecrawl to get complete markdown for search result pages. Include scrapeOptions with formats: ['markdown'] to get complete markdown content for each search result otherwise it defaults to getting SERP results (url, title, description).

This commit is contained in:
davideuler
2025-02-22 02:31:15 +08:00
parent 7b1bcfc408
commit e73f1a2b52

View File

@ -28,7 +28,12 @@ export const useWebSearch = (): WebSearchFunction => {
apiUrl: webSearchApiBase,
})
return async (q: string, o: WebSearchOptions) => {
const results = await fc.search(q, o)
const results = await fc.search(q, {
...o,
scrapeOptions: {
formats: ['markdown']
}
})
if (results.error) {
throw new Error(results.error)
}