Getting started with the Porkbun API

Good news, hobbyists, tinkerers, hackers, and other assorted nerds: you can now manipulate Porkbun DNS programmatically via our RESTful API (documented here). This API also allows you to download SSL/TLS certificate bundles, and our basic price list.

⚠️️  Note

As of 2025, the host name for our API has changed from "porkbun.com" to "api.porkbun.com". If you're suddenly running into errors when using our API, check to make sure you're querying the new endpoints, which are outlined in our API documentation.

We're on Postman! Check out our public collection here.

To kick-start your API adventure, we built a few basic programs that already know how to talk to the API:

Generating API Keys

Whether you're using one of our example apps or coding your own, the first thing you'll need to do is generate an API key and a Secret Key:

1
Log in. You should arrive at the Domain Management screen.
2
Click on ACCOUNT in the top-right corner and select "API Access"

API Access option on account menu

3
Create a name for your API key (this can be whatever you want). After inputting the name, click on "Create API Key".

Create API Key after naming it

4
A new box will appear that contains your API Key and your Secret Key.

Secret key and API Key display after creating keys

⚠️️  Note

Do not close or navigate away from the page with the SUCCESS! message until you have saved your Secret Key. It will only be visible to you this one time. If you close this page before you save your Secret Key, you'll have to delete the key and generate a new one.

Installing keys and enabling API access on specific domains

1
Install the key by copying and pasting the API Key and Secret Key you generated in the previous section into the configuration for your application. For instance, if you're using a Porkbun Dynamic DNS client, you'll want to rename config.json.example to config.json, copy and paste the corresponding values into the file, then save the file.

API Keys inputted into API client request

2
You still need to enable API access for each individual domain to be manipulated via the API. Click on ACCOUNT in the top-right corner and select Domain Management.

3
Locate the domain on which you wish to enable API access. Click Details to the far right, then locate the "API Access" option and click to enable it.

API Access toggle in Domain Management page

Enabled API Access option

Congrats! You successfully generated API keys, installed the keys, and switched on access for at least one domain. You can now use the Dynamic DNS client or other Porkbun utilities that use the API. Or, if you're coding your own program from scratch, here's a link to the API reference.

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.