Getting Started with the Porkbun API
The Porkbun API lets you register and manage domains, DNS and more from your own code.
- Create a key. At porkbun.com/account/api, create an API key. You get a public key (
pk1_…) and a secret key (sk1_…), which is shown only once. - Turn on API access. By default each domain must be opted in individually (Details panel in Domain Management). Turn on Opt In All Domains on the API page to include every domain, including future ones.
- Make a call. Send both keys as
X-API-Key/X-Secret-API-Keyheaders (or in the JSON body) tohttps://api.porkbun.com/api/json/v3/. Start with/pingto check your keys. - Read the docs. Full reference: porkbun.com/api/json/v3/documentation. For AI agents: porkbun.com/llms.txt.
Keep keys safe
Limit a key to specific domains and IP addresses in its settings, set a monthly API spend limit, and never commit keys to code repositories. A free sandbox key (pk1_sb_…) lets you test without real registrations or charges.