# Porkbun API v3 — Marketplace

> Browse domains listed for sale on Porkbun Marketplace (names Porkbun customers list themselves). To search every aftermarket at once (Afternic, Sedo, Atom, NameBright, DAX and Porkbun Marketplace), use `GET /aftermarket/search`.

Part of the Porkbun API v3.63. Topic index: https://porkbun.com/llms · Full reference: https://porkbun.com/llms-full.txt · Overview: https://porkbun.com/llms.txt · OpenAPI spec: https://porkbun.com/api/json/v3/spec

**Auth:** send `X-API-Key` / `X-Secret-API-Key` headers (preferred) or `apikey` / `secretapikey` in the JSON body. Create keys at https://porkbun.com/account/api

---

# Endpoints

## GET /api/json/v3/marketplace/getAll

**List marketplace domains**

GET form of `/marketplace/getAll` for read-friendly filtering and URL-shareable searches. Authenticate via `X-API-Key` and `X-Secret-API-Key` headers, or `Authorization: Bearer <token>`. All filter params are optional and mirror the POST body. For multi-value `tlds`, use bracket syntax: `?tlds[]=com&tlds[]=io`.

See the POST documentation for the full filtering semantics (unfiltered pagination vs filtered mode, `+include` / `-exclude` query prefixes, sort options).

**Key permission needed:** `read`

| Parameter | In | Required | Description |
|---|---|---|---|
| `Authorization` | header | no | Bearer token: `Authorization: Bearer <token>` |
| `X-API-Key` | header | no | API key header auth (use with X-Secret-API-Key) |
| `X-Secret-API-Key` | header | no | Secret API key header auth (use with X-API-Key) |
| `query` | query | no | SLD substring search. Multi-word; prefix a term with `-` to exclude. Example: `ai -test`. |
| `tlds` | query | no | Filter to listings under these TLDs (without leading dot). Use bracket form: `?tlds[]=com&tlds[]=io`. |
| `sldLengthMin` | query | no | Minimum SLD character length. |
| `sldLengthMax` | query | no | Maximum SLD character length. |
| `sortName` | query | no | Field to sort filtered results by. |
| `sortDirection` | query | no | Sort direction. |
| `start` | query | no | Pagination offset (unfiltered mode only). |
| `limit` | query | no | Page size (unfiltered mode only). Default 1000, max 5000. |

```bash
curl 'https://api.porkbun.com/api/json/v3/marketplace/getAll?query=ai&tlds[]=com&tlds[]=io&sldLengthMax=6&sortName=price&sortDirection=asc' \
  -H 'X-API-Key: pk1_...' \
  -H 'X-Secret-API-Key: sk1_...'
```

Response fields:

| Field | Type | Description |
|---|---|---|
| `status` | string |  |
| `count` | integer |  |
| `filtered` | boolean |  |
| `domains` | object[] |  |

## POST /api/json/v3/marketplace/getAll

**List marketplace domains**

Retrieve domains listed on the Porkbun marketplace. Two modes:

- **Unfiltered (default):** paginated raw listing, up to 5000 entries per call via `start` / `limit`.
- **Filtered:** when any of `query`, `tlds`, `sldLengthMin`, `sldLengthMax`, or `sortName` is provided, results are filtered server-side. Filtered mode returns up to 1000 matching listings (matches the web UI's marketplace search).

`query` supports `+include` and `-exclude` prefixes per word against the SLD (e.g. `+ai -test` matches SLDs containing 'ai' but not 'test'). Token-based access is not supported.

**Key permission needed:** `read`

| Parameter | In | Required | Description |
|---|---|---|---|
| `Idempotency-Key` | header | no | Optional, recommended on every purchase and write. Send a unique value (a UUID) per intended operation. Repeating the request with the same key and an identical body within 24 hours returns the original response instead of doing it again, so a retry after a timeout cannot double-charge or double-apply. The same key with a different body returns 409 IDEMPOTENCY_KEY_MISMATCH; while the first request is still running, 409 IDEMPOTENCY_KEY_IN_USE. |

Request body fields:

| Field | Type | Required | Description |
|---|---|---|---|
| `start` | integer | no | Pagination offset (unfiltered mode only). Default 0. |
| `limit` | integer | no | Number of domains to return (unfiltered mode only). Default 1000, max 5000. |
| `query` | string | no | Search string. Each space-separated term filters by SLD substring. Prefix a term with `-` to exclude it. |
| `tlds` | string[] | no | Filter to listings under these TLDs (without the leading dot). |
| `sldLengthMin` | integer | no | Filter to listings whose SLD has at least this many characters. |
| `sldLengthMax` | integer | no | Filter to listings whose SLD has at most this many characters. |
| `sortName` | string | no | Field to sort filtered results by. Default `sld_length` ascending when `query` is set, otherwise `create_date` descending. |
| `sortDirection` | string | no | Sort direction. Defaults vary by `sortName`. |

```bash
curl -X POST https://api.porkbun.com/api/json/v3/marketplace/getAll \
  -H 'Content-Type: application/json' \
  -d '{"apikey":"pk1_...","secretapikey":"sk1_...","start":0,"limit":1000}'
```

Response fields:

| Field | Type | Description |
|---|---|---|
| `status` | string |  |
| `count` | integer | Number of domains returned in this response |
| `filtered` | boolean | True when one or more filter parameters were applied (query, tlds, sldLengthMin/Max, sortName). |
| `domains` | object[] |  |

---

## More

- Guides (how-tos): https://porkbun.com/llms/guides
- Topic index: https://porkbun.com/llms
- Full reference (one file): https://porkbun.com/llms-full.txt
- OpenAPI spec (full schemas): https://porkbun.com/api/json/v3/spec
- Short overview: https://porkbun.com/llms.txt
- Official MCP server: https://porkbun.com/mcp (`npx -y @porkbunllc/mcp-server`)
- Create API keys: https://porkbun.com/account/api
