This repository provides helper methods for easily interacting with the V3 Porkbun API. It simplifies tasks like sending requests and handling responses, so you can quickly integrate with Porkbun's services for domain management and DNS. Automate your domain.
- Shortcuts for sending requests to the Porkbun API.
- Automatic serialization and deserialization of data.
- Compatible versions with .NET Framework and .NET Core.
- The .NET Framework builds require Newtonsoft.Json.
You must have an API key and secret issued from Porkbun's API page.
First, create an instance of the Porkbun.API
class by passing your API key and secret to the constructor.
using System;
using Porkbun;
class Program {
static async Task Main(string[] args) {
// Instantiate the Porkbun API client
API api = new API("api-key", "api-secret");
// Example 1: Ping the Porkbun API
var ping = await api.Ping();
// Example 2: Add DNS record
var dns = await api.DnsAdd("domain.com", DnsRecordType.A, "mysubdomain", "1.1.1.1");
// Example 3: Get wildcard SSL auto-generated by Porkbun with ratelimit protection.
var ssl = await API.RateLimitRetry(() => api.SslGet("domain.com"));
ssl.SaveToFiles("Certificate/", "cert.crt", "private.key", "public.key");
}
}