Skip to content

Scrape

This example assumes using Firecrawl; is in scope and apiKey contains your Firecrawl API key.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
using var client = new FirecrawlClient(apiKey);

var response = await client.Scraping.ScrapeAndExtractFromUrlAsync(
    url: "https://docs.firecrawl.dev/features/scrape");

Console.WriteLine($"Success: {response.Success}");

var fileInfo = new FileInfo("output.md");
await File.WriteAllTextAsync(fileInfo.FullName, response.Data.Markdown);
Console.WriteLine($"Output file: {new Uri(fileInfo.FullName).AbsoluteUri}");