---
title: "How to get Porkbun API keys"
description: "Create a Porkbun API key and secret, switch on API access per domain, and connect the account to DNSense."
canonical_url: "https://dnsense.io/learn/how-to-get-porkbun-api-keys"
---

> Index of every page on this site: [llms.txt](https://dnsense.io/llms.txt)

Porkbun asks for two things before the API answers: a key pair on your account, and API access switched on for each domain. Skip the second and DNSense connects fine but sees no domains, which looks like a bug and is not.

## Create the key pair

1. Log in and open **Account** in the top right corner, then choose **API Access**.

![The API Access entry in the Porkbun account menu](guide-porkbun-menu.webp)

1. Give the key a name. Permissions and an optional limit to certain domains or IP addresses sit on the same form. Leave the limits empty unless you know what you are doing. A wrong IP limit makes every call fail.
2. Click **Create API Key**.

![The create API key form](guide-porkbun-create.webp)

1. Porkbun now shows the **API Key** (starts with `pk1_`) and the **Secret Key** (starts with `sk1_`). The secret is shown once. Copy both before you leave the page.

![The new API key and secret key](guide-porkbun-keys.webp)

## Switch on API access per domain

1. Go to **Account > Domain Management**.
2. Find the domain and click **Details** at the far right.
3. Turn on **API Access**.

![The API Access toggle on the domain details page](guide-porkbun-domain.webp)

Do this for every domain you want DNSense to manage.

## Connect it to DNSense

Add a connection, choose **Porkbun**, and paste the API key and the secret key into their own fields. Porkbun does not publish an API rate limit, so DNSense checks for drift on this connection less often than on others. Changes you make in DNSense are pushed straight away.

## Sitemap

See the full [sitemap](https://dnsense.io/sitemap.md) for all pages.
