The Porkbun API uses JSON content sent to URI endpoints via HTTP POST. Functionality is currently limited but as more functionality is added it will be documented here.
Please note that values in URI examples surrounded by brackets, [SUBDOMAIN] for example, are optional.
api.porkbun.com
Please note that porkbun.com currently works and has historically been the correct hostname for our API. However, we will be migrating away from that hostname and the API will no longer be available using it after 2024-12-01 00:00:00 UTC.
Some folks prefer to force IPv4, especially when using the ping command to get back an IP address for dynamic DNS clients. The dedicated IPv4 hostname is api-ipv4.porkbun.com, use this instead of porkbun.com.
Check default domain pricing information for all supported TLDs. This command does not require authentication.
A status indicating whether or not the command was successfuly processed.
Objects with default pricing for the registration, renewal and transfer of each supported TLD.
URI Endpoint: https://api.porkbun.com/api/json/v3/pricing/get
JSON Command
None
JSON Response
{ "status": "SUCCESS", "pricing": { "design": { "registration": "35.58", "renewal": "35.58", "transfer": "35.58" }, "com": { "registration": "9.68", "renewal": "9.68", "transfer": "9.68" }, ... } }
Authentication is done by passing an API key and secret API key in the JSON content posted to the URI endpoint. All API calls must include valid API keys. You can create API keys at porkbun.com/account/api. You can test communication with the API using the ping endpoint. The ping endpoint will also return your IP address, this can be handy when building dynamic DNS clients.
URI Endpoint: https://api.porkbun.com/api/json/v3/ping
JSON Command Example
{ "secretapikey": "YOUR_SECRET_API_KEY", "apikey": "YOUR_API_KEY" }
JSON Response Example
{ "status": "SUCCESS", "yourIp": "3.129.67.248" }
Any HTTP response code other than 200 is an error. Errors will also be indicated in the "status" element of the returned JSON. An HTTP response of 403 means that additional authentication information is required, such as a two factor code.
JSON Response Example
{ "status": "ERROR", "message": "All HTTP request must use POST." }
Knowledge based article with sample applications demonstrating use of the DNS management API:
Getting started with the Porkbun DNS API
Your secret API key.
Your API key.
An array of name servers that you would like to update your domain with.
A status indicating whether or not the command was successfuly processed.
URI Endpoint: https://api.porkbun.com/api/json/v3/domain/updateNs/DOMAIN
URI Endpoint Example: https://api.porkbun.com/api/json/v3/domain/updateNs/borseth.ink
JSON Command Example
{ "secretapikey": "YOUR_SECRET_API_KEY", "apikey": "YOUR_API_KEY", "ns": [ "ns1.example.com", "ns2.example.com" ] }
JSON Response Example
{ "status": "SUCCESS" }
Your secret API key.
Your API key.
A status indicating whether or not the command was successfuly processed.
An array of name server host names.
URI Endpoint: https://api.porkbun.com/api/json/v3/domain/getNs/DOMAIN
URI Endpoint Example: https://api.porkbun.com/api/json/v3/domain/getNs/borseth.ink
JSON Command Example
{ "secretapikey": "YOUR_SECRET_API_KEY", "apikey": "YOUR_API_KEY" }
JSON Response Example
{ "status": "SUCCESS", "ns": [ "curitiba.ns.porkbun.com", "fortaleza.ns.porkbun.com", "maceio.ns.porkbun.com", "salvador.ns.porkbun.com" ] }
Your secret API key.
Your API key.
An index to start at when retrieving the domains, defaults to 0. To get all domains increment by 1000 until you receive an empty array.
If set to "yes" we will return label information for the domains if it exists.
A status indicating whether or not the command was successfuly processed.
An array of domains and domain details in the account.
URI Endpoint: https://api.porkbun.com/api/json/v3/domain/listAll
URI Endpoint Example: https://api.porkbun.com/api/json/v3/domain/listAll
JSON Command Example
{ "secretapikey": "YOUR_SECRET_API_KEY", "apikey": "YOUR_API_KEY", "start": "1", "includeLabels": "yes" }
JSON Response Example
{ "status": "SUCCESS", "domains": [ { "domain": "borseth.ink", "status": "ACTIVE", "tld": "app", "createDate": "2018-08-20 17:52:51", "expireDate": "2023-08-20 17:52:51", "securityLock": "1", "whoisPrivacy": "1", "autoRenew": 0, "notLocal": 0, "labels": [ { "id": "27240", "title": "cool", "color": "#ff9e9e" }, { "id": "27241", "title": "silly", "color": "#f00000" } ] } ] }
Your secret API key.
Your API key.
A subdomain that you would like to add URL forwarding for. Leave this blank to forward the root domain.
Where you'd like to forward the domain to.
The type of forward. Valid types are: temporary or permanent
Whether or not to include the URI path in the redirection. Valid options are yes or no.
Also forward all subdomains of the domain. Valid options are yes or no.
A status indicating whether or not the command was successfuly processed.
URI Endpoint: https://api.porkbun.com/api/json/v3/domain/addUrlForward/DOMAIN
URI Endpoint Example: https://api.porkbun.com/api/json/v3/domain/addUrlForward/borseth.ink
JSON Command Example
{ "secretapikey": "YOUR_SECRET_API_KEY", "apikey": "YOUR_API_KEY", "subdomain": "", "location": "https://porkbun.com", "type": "temporary", "includePath": "no", "wildcard": "yes" }
JSON Response Example
{ "status": "SUCCESS" }
Your secret API key.
Your API key.
A status indicating whether or not the command was successfuly processed.
An array of forwarding records for the domain.
URI Endpoint: https://api.porkbun.com/api/json/v3/domain/getUrlForwarding/DOMAIN
URI Endpoint Example: https://api.porkbun.com/api/json/v3/domain/getUrlForwarding/borseth.ink
JSON Command Example
{ "secretapikey": "YOUR_SECRET_API_KEY", "apikey": "YOUR_API_KEY" }
JSON Response Example
{ "status": "SUCCESS", "forwards": [ { "id": "22049216", "subdomain": "", "location": "https://porkbun.com", "type": "temporary", "includePath": "no", "wildcard": "yes" }, { "id": "22049209", "subdomain": "blog", "location": "https://blog.porkbun.com", "type": "temporary", "includePath": "no", "wildcard": "yes" } ] }
Your secret API key.
Your API key.
A status indicating whether or not the command was successfuly processed.
URI Endpoint: https://api.porkbun.com/api/json/v3/domain/deleteUrlForward/DOMAIN/RECORD ID
URI Endpoint Example: https://api.porkbun.com/api/json/v3/domain/deleteUrlForward/borseth.ink/22049209
JSON Command Example
{ "secretapikey": "YOUR_SECRET_API_KEY", "apikey": "YOUR_API_KEY" }
JSON Response Example
{ "status": "SUCCESS" }
Your secret API key.
Your API key.
The subdomain for the record being created, not including the domain itself. Leave blank to create a record on the root domain. Use * to create a wildcard record.
The type of record being created. Valid types are: A, MX, CNAME, ALIAS, TXT, NS, AAAA, SRV, TLSA, CAA, HTTPS, SVCB
The answer content for the record. Please see the DNS management popup from the domain management console for proper formatting of each record type.
The time to live in seconds for the record. The minimum and the default is 600 seconds.
The priority of the record for those that support it.
A status indicating whether or not the command was successfuly processed.
The ID of the record created.
URI Endpoint: https://api.porkbun.com/api/json/v3/dns/create/DOMAIN
URI Endpoint Example: https://api.porkbun.com/api/json/v3/dns/create/borseth.ink
JSON Command Example
{ "secretapikey": "YOUR_SECRET_API_KEY", "apikey": "YOUR_API_KEY", "name": "www", "type": "A", "content": "1.1.1.1", "ttl": "600" }
JSON Response Example
{ "status": "SUCCESS", "id": "106926659" }
Your secret API key.
Your API key.
The subdomain for the record being created, not including the domain itself. Leave blank to create a record on the root domain. Use * to create a wildcard record.
The type of record being created. Valid types are: A, MX, CNAME, ALIAS, TXT, NS, AAAA, SRV, TLSA, CAA, HTTPS, SVCB
The answer content for the record. Please see the DNS management popup from the domain management console for proper formatting of each record type.
The time to live in seconds for the record. The minimum and the default is 600 seconds.
The priority of the record for those that support it.
A status indicating whether or not the command was successfuly processed.
URI Endpoint: https://api.porkbun.com/api/json/v3/dns/edit/DOMAIN/ID
URI Endpoint Example: https://api.porkbun.com/api/json/v3/dns/edit/borseth.ink/106926659
JSON Command Example
{ "secretapikey": "YOUR_SECRET_API_KEY", "apikey": "YOUR_API_KEY", "name": "www", "type": "A", "content": "1.1.1.2", "ttl": "600" }
JSON Response Example
{ "status": "SUCCESS" }
Your secret API key.
Your API key.
The answer content for the record. Please see the DNS management popup from the domain management console for proper formatting of each record type.
The time to live in seconds for the record. The minimum and the default is 600 seconds.
The priority of the record for those that support it.
A status indicating whether or not the command was successfuly processed.
URI Endpoint: https://api.porkbun.com/api/json/v3/dns/editByNameType/DOMAIN/TYPE/[SUBDOMAIN]
URI Endpoint Example: https://api.porkbun.com/api/json/v3/dns/editByNameType/borseth.ink/A/www
JSON Command Example
{ "secretapikey": "YOUR_SECRET_API_KEY", "apikey": "YOUR_API_KEY", "content": "1.1.1.2", "ttl": "600" }
JSON Response Example
{ "status": "SUCCESS" }
Your secret API key.
Your API key.
A status indicating whether or not the command was successfuly processed.
URI Endpoint: https://api.porkbun.com/api/json/v3/dns/delete/DOMAIN/ID
URI Endpoint Example: https://api.porkbun.com/api/json/v3/dns/delete/borseth.ink/106926659
JSON Command Example
{ "secretapikey": "YOUR_SECRET_API_KEY", "apikey": "YOUR_API_KEY" }
JSON Response Example
{ "status": "SUCCESS" }
Your secret API key.
Your API key.
A status indicating whether or not the command was successfuly processed.
URI Endpoint: https://api.porkbun.com/api/json/v3/dns/deleteByNameType/DOMAIN/TYPE/[SUBDOMAIN]
URI Endpoint Example: https://api.porkbun.com/api/json/v3/dns/deleteByNameType/borseth.ink/A/www
JSON Command Example
{ "secretapikey": "YOUR_SECRET_API_KEY", "apikey": "YOUR_API_KEY" }
JSON Response Example
{ "status": "SUCCESS" }
Your secret API key.
Your API key.
A status indicating whether or not the command was successfuly processed.
An array of DNS records.
URI Endpoint: https://api.porkbun.com/api/json/v3/dns/retrieve/DOMAIN/ID
URI Endpoint w/ ID: https://api.porkbun.com/api/json/v3/dns/retrieve/DOMAIN/IDURI Endpoint Example: https://api.porkbun.com/api/json/v3/dns/retrieve/borseth.ink
JSON Command Example
URI Endpoint Example w/ ID: https://api.porkbun.com/api/json/v3/dns/retrieve/borseth.ink/106926652
{ "secretapikey": "YOUR_SECRET_API_KEY", "apikey": "YOUR_API_KEY" }
JSON Response Example
{ "status": "SUCCESS", "records": [ { "id": "106926652", "name": "borseth.ink", "type": "A", "content": "1.1.1.1", "ttl": "600", "prio": "0", "notes": "" }, { "id": "106926659", "name": "www.borseth.ink", "type": "A", "content": "1.1.1.1", "ttl": "600", "prio": "0", "notes": "" } ] } JSON Response Example w/ ID
{ "status": "SUCCESS", "records": [ { "id": "106926652", "name": "borseth.ink", "type": "A", "content": "1.1.1.1", "ttl": "600", "prio": "0", "notes": "" } ] }
Your secret API key.
Your API key.
A status indicating whether or not the command was successfuly processed.
An array of DNS records.
URI Endpoint: https://api.porkbun.com/api/json/v3/dns/retrieveByNameType/DOMAIN/TYPE/[SUBDOMAIN]
URI Endpoint Example: https://api.porkbun.com/api/json/v3/dns/retrieveByNameType/borseth.ink/A/www
JSON Command Example
{ "secretapikey": "YOUR_SECRET_API_KEY", "apikey": "YOUR_API_KEY" }
JSON Response Example
{ "status": "SUCCESS", "records": [ { "id": "106926659", "name": "www.borseth.ink", "type": "A", "content": "1.1.1.1", "ttl": "600", "prio": "0", "notes": "" } ] }
Your secret API key.
Your API key.
A status indicating whether or not the command was successfuly processed.
The complete certificate chain.
The private key.
The public key.
URI Endpoint: https://api.porkbun.com/api/json/v3/ssl/retrieve/DOMAIN
URI Endpoint Example: https://api.porkbun.com/api/json/v3/ssl/retrieve/borseth.ink
JSON Command Example
{ "secretapikey": "YOUR_SECRET_API_KEY", "apikey": "YOUR_API_KEY" }
JSON Response Example
{ "status": "SUCCESS", "certificatechain": "----BEGIN CERTIFICATE-----\n...-----END CERTIFICATE-----\n\n----BEGIN CERTIFICATE-----\n...-----END CERTIFICATE-----\n\n----BEGIN CERTIFICATE-----\n...-----END CERTIFICATE-----\n", "privatekey": "-----BEGIN PRIVATE KEY-----\n...-----END PRIVATE KEY-----\n", "publickey": "-----BEGIN PUBLIC KEY-----\n...-----END PUBLIC KEY-----\n" }