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
11
12
13
14
15
using var client = new FirecrawlClient(apiKey);

var response = await client.Scraping.ScrapeAndExtractFromUrlAsync(new AllOf<ScrapeAndExtractFromUrlRequest2, ScrapeOptions>
{
    Value1 = new ScrapeAndExtractFromUrlRequest2
    {
        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}");