Examples¶
Welcome to the Oinker examples! This section provides practical, copy-paste-ready code for every Porkbun API operation.
Quick Navigation¶
| Section | What You'll Learn |
|---|---|
| DNS Records | Create, list, update, and delete DNS records of all types |
| Domains | Manage nameservers, URL forwarding, glue records, and check availability |
| DNSSEC | Configure DNSSEC at the registry level |
| SSL Certificates | Retrieve free SSL certificates for your domains |
| Pricing | Query TLD pricing (no authentication required) |
| Dynamic DNS | Build a complete dynamic DNS updater script |
Before You Start¶
Installation¶
Authentication¶
Set your Porkbun API credentials:
Getting API Keys
- Log in to Porkbun
- Go to Account > API Access
- Create an API key pair
- Enable API access for each domain you want to manage
Async vs Sync¶
All examples show both async and sync versions. Use async for web applications and concurrent operations; use sync for scripts and CLI tools.
Example Structure¶
Each example page follows this pattern:
- Quick Start - The most common operation
- All Operations - Every API method with examples
- Real-World Patterns - Practical use cases combining multiple operations
Ready to dive in? Start with DNS Records - the most commonly used API.