Cloudflare.NET.Api 3.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Cloudflare.NET.Api --version 3.2.0
                    
NuGet\Install-Package Cloudflare.NET.Api -Version 3.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Cloudflare.NET.Api" Version="3.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Cloudflare.NET.Api" Version="3.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Cloudflare.NET.Api" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Cloudflare.NET.Api --version 3.2.0
                    
#r "nuget: Cloudflare.NET.Api, 3.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Cloudflare.NET.Api@3.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Cloudflare.NET.Api&version=3.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Cloudflare.NET.Api&version=3.2.0
                    
Install as a Cake Tool

Cloudflare.NET - .NET SDK for Cloudflare API

.NET Build and Test Documentation License: Apache-2.0

NuGet (Cloudflare.NET.Api) NuGet (Cloudflare.NET.R2) NuGet (Cloudflare.NET.Analytics)

Cloudflare.NET is a comprehensive C# client library for the Cloudflare REST API. It provides strongly-typed access to Cloudflare services including DNS management, Zone configuration, R2 object storage, Workers, WAF rules, and more. Built with testability and maintainability in mind.

Cloudflare does not provide an official .NET SDK or C# library. This project aims to fill that gap with a community-maintained alternative.

Documentation | Getting Started | API Reference

Packages

Package Description
Cloudflare.NET.Api Core REST API client for Zones, DNS, Security, and R2 bucket management
Cloudflare.NET.R2 High-level S3-compatible client for R2 object storage
Cloudflare.NET.Analytics GraphQL client for Cloudflare Analytics API
dotnet add package Cloudflare.NET.Api
dotnet add package Cloudflare.NET.R2        # Optional
dotnet add package Cloudflare.NET.Analytics # Optional

Example

// Register in Program.cs
builder.Services.AddCloudflareApiClient(builder.Configuration);
builder.Services.AddCloudflareR2Client(builder.Configuration);

// Inject and use
public class MyService(ICloudflareApiClient cf)
{
    public async Task<DnsRecord?> FindRecordAsync(string zoneId, string hostname)
        => await cf.Zones.FindDnsRecordByNameAsync(zoneId, hostname);
}

Features

  • Strongly-typed API · Full IntelliSense with comprehensive XML documentation and proper nullability annotations

  • CI/CD Pipeline · Every commit triggers automated builds and tests; releases published automatically to NuGet

  • Resilience Built-in · Automatic retries, circuit breaker, proactive throttling based on rate limit headers, and configurable timeouts via Polly

  • Multi-account Support · Named clients and keyed services for managing multiple Cloudflare accounts

  • Dependency Injection · First-class support for Microsoft.Extensions.DependencyInjection with IHttpClientFactory

  • S3-Compatible R2 · Intelligent multipart uploads, presigned URLs, and automatic retry handling

  • Testable by Design · Integration tests against real Cloudflare APIs and unit tests for request/response validation

Get Started

<div align="center">

📚 Ready to dive in?

Explore the Full Documentation →

Comprehensive guides, configuration options, multi-account setup, and more.

</div>

API Coverage

API Family Features
Zones CRUD, Holds, Settings, Subscriptions, Cache Purge, Custom Hostnames (SaaS)
DNS Record CRUD, Batch Operations, Import/Export, Record Scanning
Zone Security IP Access Rules, Zone Lockdown, User-Agent Rules, WAF Rulesets
Accounts Management, Members, Roles, Audit Logs, API Tokens, Subscriptions
Account Storage R2 Buckets, R2 Custom Domains, R2 CORS, R2 Lifecycle Policies
Account Security IP Access Rules, WAF Rulesets
Users Profile Management, Memberships, Invitations, Audit Logs, API Tokens, Subscriptions
Workers Routes (zone-scoped)
Workers KV Namespace CRUD, Key-Value CRUD, Metadata, Expiration, Bulk Operations
Turnstile Widget CRUD, Secret Rotation
R2 Client Upload, Download, Multipart, Presigned URLs, Batch Delete
Analytics GraphQL queries for traffic, security, and R2 metrics

See API Coverage for full details and roadmap.

Supported Frameworks

Package .NET 8 .NET 9 .NET 10 Strong Named
Cloudflare.NET.Api
Cloudflare.NET.R2
Cloudflare.NET.Analytics ❌*

* Cloudflare.NET.Analytics cannot be strong-named because its dependency (GraphQL.Client) is not strong-named.

Contributing

We welcome contributions! Whether it's bug reports, feature requests, or code contributions.

License

This project is licensed under the Apache 2.0 License.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Cloudflare.NET.Api:

Package Downloads
Cloudflare.NET.R2

Cloudflare R2 storage client for .NET. High-level S3-compatible API with multipart uploads, presigned URLs, batch operations, and automatic retry handling. Part of the Cloudflare.NET SDK.

Cloudflare.NET.Analytics

An extension package for Cloudflare.NET that provides a strongly-typed client for the Cloudflare Analytics GraphQL API.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.4.0 6,680 1/30/2026
3.3.0 1,067 12/25/2025
3.2.0 269 12/24/2025
3.1.0 1,688 12/23/2025
3.0.0 266 12/23/2025
2.2.0 259 12/20/2025
2.1.2 359 12/18/2025
2.1.1 314 12/14/2025
2.1.0 320 12/14/2025
2.0.0 228 12/13/2025
1.5.1 547 12/9/2025
1.5.0 543 12/9/2025
1.4.0 542 12/9/2025
1.3.2 946 12/9/2025
1.3.1 520 12/8/2025
1.3.0 519 12/8/2025
1.2.0 513 12/8/2025
1.1.0 348 12/7/2025
1.0.3 313 12/7/2025
1.0.2 340 12/7/2025
Loading failed