|
| 1 | +# Firecrawl |
| 2 | + |
| 3 | +[](https://www.nuget.org/packages/Firecrawl/) |
| 4 | +[](https://github.com/tryAGI/Firecrawl/actions/workflows/dotnet.yml) |
| 5 | +[](https://github.com/tryAGI/Firecrawl/blob/main/LICENSE.txt) |
| 6 | +[](https://discord.gg/Ca2xhfBf3v) |
| 7 | + |
| 8 | +## Features 🔥 |
| 9 | +- Fully generated C# SDK based on [official Firecrawl OpenAPI specification](https://raw.githubusercontent.com/mendableai/firecrawl/main/apps/api/v1-openapi.json) using [AutoSDK](https://github.com/tryAGI/AutoSDK) |
| 10 | +- Same day update to support new features |
| 11 | +- Updated and supported automatically if there are no breaking changes |
| 12 | +- All modern .NET features - nullability, trimming, NativeAOT, etc. |
| 13 | +- Support .Net Framework/.Net Standard 2.0 |
| 14 | + |
| 15 | +### Usage |
| 16 | +```csharp |
| 17 | +using Firecrawl; |
| 18 | + |
| 19 | +using var client = new FirecrawlClient(apiKey); |
| 20 | + |
| 21 | +// Scrape |
| 22 | +var response = await client.Scraping.ScrapeAndExtractFromUrlAsync("https://docs.firecrawl.dev/features/scrape"); |
| 23 | + |
| 24 | +string markdown = response.Data.Markdown; |
| 25 | + |
| 26 | +// Crawl |
| 27 | +var response = await client.Crawling.CrawlUrlsAsync( |
| 28 | + url: "https://docs.firecrawl.dev/", |
| 29 | + limit: 3, |
| 30 | + scrapeOptions: new CrawlUrlsRequestScrapeOptions |
| 31 | + { |
| 32 | + OnlyMainContent = true, |
| 33 | + }); |
| 34 | + |
| 35 | +var jobResponse = await client.Crawling.WaitJobAsync( |
| 36 | + jobId: response.JobId); |
| 37 | + |
| 38 | +foreach (var data in jobResponse.Data) |
| 39 | +{ |
| 40 | + Console.WriteLine($"URL: {data.Metadata.SourceURL}"); |
| 41 | + Console.WriteLine($"Output file: {data.Markdown}"); |
| 42 | +} |
| 43 | +``` |
| 44 | + |
| 45 | +### CLI |
| 46 | +```bash |
| 47 | +dotnet tool install -g Firecrawl.Cli |
| 48 | +firecrawl auth <API_KEY> |
| 49 | +firecrawl scrape https://docs.firecrawl.dev/features/scrape // saves it to output.md |
| 50 | +firecrawl crawl https://docs.firecrawl.dev/ --limit 5 // saves all .md files to docs.firecrawl.dev folder |
| 51 | +``` |
| 52 | + |
| 53 | +## Support |
| 54 | + |
| 55 | +Priority place for bugs: https://github.com/tryAGI/Firecrawl/issues |
| 56 | +Priority place for ideas and general questions: https://github.com/tryAGI/Firecrawl/discussions |
| 57 | +Discord: https://discord.gg/Ca2xhfBf3v |
| 58 | + |
| 59 | +## Acknowledgments |
| 60 | + |
| 61 | + |
| 62 | + |
| 63 | +This project is supported by JetBrains through the [Open Source Support Program](https://jb.gg/OpenSourceSupport). |
| 64 | + |
| 65 | + |
| 66 | + |
| 67 | +This project is supported by CodeRabbit through the [Open Source Support Program](https://github.com/marketplace/coderabbitai). |
0 commit comments