Porkbun Aftermarket API
Registered domains that are for sale: partner aftermarkets (Afternic, Sedo, Atom, NameBright, DAX), Porkbun Marketplace and DAX auctions, in one search. Read-only; buying happens on porkbun.com through each listing's buyUrl.
Registered domains that are for sale: partner aftermarkets (Afternic, Sedo, Atom, NameBright, DAX), Porkbun Marketplace and DAX auctions, in one search. Read-only; buying happens on porkbun.com through each listing's buyUrl.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/porkbun-com:porkbun-com-aftermarket-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Porkbun API v3 Aftermarket API
version: '3.109'
description: 'The Porkbun API enables programmatic domain registration, DNS management, SSL certificate retrieval, and related operations. It is fully usable by AI agents, automation scripts, and developer tools. ## Sandbox / test mode
Build and test an integration end-to-end with **no real registry actions, no DNS changes, no certificates, and no charges** by using a **sandbox API key** — a public key prefixed `pk1_sb_` (secret `sk1_sb_`), created at https://porkbun.com/account/api. Same base URL; just swap the key. In sandbox:
- **A sandbox key sees only sandbox data.** Domains, DNS records, contacts and everything else in your live Porkbun account are invisible to it, including on a key you created on your own API Access page. Calling a live domain in the sandbox returns `INVALID_DOMAIN` for that reason, not because the name is wrong. - **Everything in the sandbox is created through the API.** The website only creates the keys. Register a test domain with `POST /domain/create/{domain}` first; that also creates its DNS zone, so there is no separate zone step. - **First steps:** `POST /domain/checkDomain/{name}` on a name nobody has registered, then `POST /domain/create/{domain}`, then `POST /dns/create/{domain}`, then `GET /dns/retrieve/{domain}`. - Every response includes `"sandbox": true` and an `X-Porkbun-Sandbox: true` header. - Registrations, renewals, transfers, DNS, contacts, nameservers, glue, and DNSSEC are simulated against an isolated datastore; your account starts with fake credit (top up/reset via `/sandbox/topup` and `/sandbox/reset`). Availability and pricing reflect the real catalog so quotes match production. - Endpoints that can''t be simulated — **hosting**, **email**, **closeouts** and **agent naming (ANS)** — return `SANDBOX_UNSUPPORTED`. Closeouts are excluded because the inventory and the purchase both live with a third party that has no test environment, so a simulated buy would claim a real domain. - **Webhooks are delivered in the sandbox.** Register an endpoint with `POST /webhook/create`, then either perform an operation (the matching signed event is delivered just like production) or fire any event on demand with `POST /sandbox/triggerWebhook` to test your handler and signature verification. ## Mock server (no credentials)
Learn any endpoint''s exact response shape with **zero setup** — no key, no account. Every real path is mirrored under `/mock`:
- `GET /mock` lists every mockable endpoint. - `GET|POST /mock/` returns a schema-accurate example response for that operation (e.g. `/mock/domain/listAll`). Append `?status=error` for the error shape. Mock responses touch no datastore, are identical in shape to the live API, and are signalled by an `X-Porkbun-Mock: true` header. Use it to build client code before you have credentials; switch to a sandbox key when you want real behavior with fake money. ## Quickstart
**1. Get your API keys** — visit https://porkbun.com/account/api
**2. Test connectivity**
```bash
curl https://api.porkbun.com/api/json/v3/ip
```
Returns your public IP. No credentials required. **3. Check domain availability** (also verifies your credentials)
```bash
curl -X POST https://api.porkbun.com/api/json/v3/domain/checkDomain/example.com \
-H "Content-Type: application/json" \
-d ''{"apikey":"your_api_key","secretapikey":"your_secret_key"}''
```
Returns `avail: "yes"/"no"` and `price` in USD. Returns an error if credentials are invalid. **4. Register the domain** — convert `price` to pennies (e.g. $9.73 → 973) for `cost`
```bash
curl -X POST https://api.porkbun.com/api/json/v3/domain/create/example.com \
-H "Content-Type: application/json" \
-d ''{"apikey":"your_api_key","secretapikey":"your_secret_key","cost":973,"agreeToTerms":"yes"}''
```
**5.'
contact:
name: Porkbun Support
url: https://porkbun.com/support
x-logo:
url: https://porkbun.com/img/logo.png
servers:
- url: https://api.porkbun.com/api/json/v3
description: Production
- url: https://api-ipv4.porkbun.com/api/json/v3
description: Production (IPv4 only — use this if your client is on an IPv6 network and needs to reach the API over IPv4)
security:
- ApiKeyHeader: []
SecretApiKeyHeader: []
tags:
- name: Aftermarket
description: 'Registered domains that are for sale: partner aftermarkets (Afternic, Sedo, Atom, NameBright, DAX), Porkbun Marketplace and DAX auctions, in one search. Read-only; buying happens on porkbun.com through each listing''s buyUrl.'
paths:
/aftermarket/search:
get:
tags:
- Aftermarket
summary: Search domains for sale on the aftermarket
operationId: aftermarketSearch
description: 'Find registered domains that are for sale: the partner aftermarket (Afternic, Sedo, Atom, NameBright and DAX listings, merged to the lowest price per name), Porkbun Marketplace, and DAX auctions. The same listings the website''s search shows. Use it when `checkDomain` says a name is taken (its `aftermarketSearch` field links here), or to browse names for sale by keyword.
`query` is a keyword (`coffee`) or a full domain (`coffee.com`). For a full domain, `exactMatch` holds its listing if it has one, and related listings follow. Results come back as: the exact name first, then buy-now listings, then make-offer, then auctions, each by price.
**Read `saleType` before quoting a price.** `buy_now`: `price` is the price to buy it. `make_offer`: `price` is the seller''s minimum offer, not a price. `auction`: `price` is the current bid. All prices are integer US cents and are the current listed price; the binding price is set at checkout.
**Buying is on the website, not the API:** send the user to the listing''s `buyUrl`. An aftermarket name arrives by transfer from the seller, usually within a few days (`fastTransfer: true` is quicker).
A cold search queries several marketplaces and can take a few seconds; results are cached for 10 minutes. Limited to 20 searches a minute per account (`RATE_LIMIT_EXCEEDED`). If a source cannot be reached, the others are still returned and `sourcesUnavailable` names it. Also accepts POST with the same fields in the body. Works with sandbox keys (the listings are real).'
parameters:
- name: query
in: query
required: true
schema:
type: string
description: A keyword or a full domain.
example: coffee
- name: tld
in: query
required: false
schema:
type: string
description: Only listings on this TLD, with or without the leading dot.
example: com
- name: saleType
in: query
required: false
schema:
type: string
enum:
- buy_now
- make_offer
- auction
description: Only this kind of listing.
- name: priceMin
in: query
required: false
schema:
type: integer
description: Minimum price, integer US cents.
example: 10000
- name: priceMax
in: query
required: false
schema:
type: integer
description: Maximum price, integer US cents.
example: 500000
- name: limit
in: query
required: false
schema:
type: integer
default: 50
maximum: 200
description: Listings to return (1-200, default 50). `total` says how many matched.
responses:
'200':
description: Listings (possibly none).
content:
application/json:
schema:
type: object
properties:
status:
type: string
example: SUCCESS
query:
type: string
example: fun.now
exactMatch:
description: The listing for the exact domain searched, or null.
allOf:
- $ref: '#/components/schemas/AftermarketListing'
listings:
type: array
items:
$ref: '#/components/schemas/AftermarketListing'
count:
type: integer
example: 50
total:
type: integer
description: Listings that matched before `limit`.
example: 200
sourcesUnavailable:
type: array
items:
type: string
description: Sources that could not be searched this time (partners, marketplace, daxauction).
example: []
note:
type: string
headers:
X-RateLimit-Limit:
$ref: '#/components/headers/XRateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/XRateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/XRateLimitReset'
X-RateLimit-Window:
$ref: '#/components/headers/XRateLimitWindow'
X-RateLimit-Mode:
$ref: '#/components/headers/XRateLimitMode'
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: Invalid filter (`INVALID_INPUT`, `INVALID_TLD`)
'502':
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
description: Inventory provider unreachable (`CLOSEOUT_SOURCE_UNAVAILABLE`)
'429':
$ref: '#/components/responses/RateLimited'
x-porkbun-agent:
safe: true
cost: false
destructive: false
reversible: true
requiresConfirmation: false
x-porkbun-scope: read
components:
responses:
RateLimited:
description: Rate limit exceeded (code RATE_LIMIT_EXCEEDED). Wait Retry-After seconds, then retry the same request.
headers:
Retry-After:
$ref: '#/components/headers/RetryAfter'
X-RateLimit-Limit:
$ref: '#/components/headers/XRateLimitLimit'
X-RateLimit-Remaining:
$ref: '#/components/headers/XRateLimitRemaining'
X-RateLimit-Reset:
$ref: '#/components/headers/XRateLimitReset'
X-RateLimit-Window:
$ref: '#/components/headers/XRateLimitWindow'
X-RateLimit-Mode:
$ref: '#/components/headers/XRateLimitMode'
content:
application/json:
schema:
$ref: '#/components/schemas/RateLimitExceeded'
headers:
RetryAfter:
description: 'On 429: whole seconds to wait before retrying.'
schema:
type: integer
XRateLimitLimit:
description: Requests allowed per window for this API key (the general per-key limiter).
schema:
type: integer
XRateLimitRemaining:
description: Requests left in the current window for this API key.
schema:
type: integer
XRateLimitReset:
description: Seconds until the current window resets.
schema:
type: integer
XRateLimitWindow:
description: Window length in seconds.
schema:
type: integer
XRateLimitMode:
description: '`observe` while the general per-key limiter only measures and refuses nothing. Endpoint-specific limits (availability checks, registrations, renewals and others) are enforced regardless, with 429 and Retry-After.'
schema:
type: string
enum:
- observe
schemas:
AftermarketListing:
type: object
properties:
domain:
type: string
example: fun.now
tld:
type: string
example: now
price:
type: integer
description: 'Integer US cents. What it means depends on saleType: see priceMeaning.'
example: 4988800
priceDisplay:
type: string
example: $49,888.00
priceMeaning:
type: string
enum:
- buy_now_price
- minimum_offer
- current_bid
saleType:
type: string
enum:
- buy_now
- make_offer
- auction
source:
type: string
description: afternic, sedo, atom, namebright, dax or marketplace (Porkbun Marketplace).
example: sedo
fastTransfer:
type: boolean
description: The seller supports a fast transfer.
example: false
buyUrl:
type: string
description: Where the user buys (or bids on) it on porkbun.com.
example: https://porkbun.com/checkout/search?q=fun.now
RateLimitExceeded:
type: object
required:
- status
- message
properties:
status:
type: string
enum:
- ERROR
example: ERROR
message:
type: string
example: Rate limit exceeded. Please try again later.
code:
type: string
example: RATE_LIMIT_EXCEEDED
ttlRemaining:
type: integer
description: Seconds until the rate limit window resets. Present on some endpoints.
ErrorResponse:
type: object
required:
- status
- message
properties:
status:
type: string
enum:
- ERROR
example: ERROR
message:
type: string
description: Human-readable description of the error
example: Invalid domain.
code:
type: string
description: Machine-readable error code. Use for programmatic handling; use `message` for display. See the Error codes section in the API description for a full list.
example: INVALID_DOMAIN
account:
type: string
description: 'On DOMAIN_NOT_FOUND, DOMAIN_NOT_REGISTERED, API_ACCESS_DISABLED and the /dns/* INVALID_DOMAIN: the username of the account the key belongs to'
next_action:
type: object
description: 'Present on many errors: a machine-readable remediation hint so an agent can self-correct without parsing the message. Absent when no specific action applies.'
properties:
type:
type: string
description: Stable action category an agent can branch on.
enum:
- fix_request
- authenticate
- enable_setting
- verify_account
- add_funds
- top_up
- retry
- wait_and_retry
- pay
- use_website
- choose_alternative
- contact_support
- none
example: fix_request
hint:
type: string
description: Human-readable instruction.
example: Re-fetch the price via /domain/checkDomain and resend the matching cost.
url:
type: string
description: Where to take the action, when applicable.
example: https://porkbun.com/account/api
securitySchemes:
ApiKeyHeader:
type: apiKey
in: header
name: X-API-Key
description: Your API key. Use together with X-Secret-API-Key.
SecretApiKeyHeader:
type: apiKey
in: header
name: X-Secret-API-Key
description: Your secret API key. Use together with X-API-Key.