Using the Firecrawl API
You can use the following endpoints in the Firecrawl API:/v0/scrape- scrape a webpage and extract text docs/v0/search- searches the web based on a given keyword docs
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Using the Firecrawl API in your bots
/v0/scrape - scrape a webpage and extract text docs/v0/search - searches the web based on a given keyword docsexport async function main(inputs, params, accounts) {
const { url } = inputs;
let res = await fetch('https://api.firecrawl.dev/v0/scrape', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
url,
"pageOptions": {
"onlyMainContent": true,
"includeHtml": false
},
"timeout": 30000
})
})
res = await res.json()
const markdown = res.data.markdown
return {
title: 'Content',
markdown
}
}