# get_domain_price

Source: https://modulify.ai/docs/api/bought-domains/get-domain-price

Prices buying a domain, or renewing one the workspace bought, for a term in whole years.

- Title: Price a domain for a term
- Scope: `domains:read`
- Access: Read only
- Endpoint: `POST /v1/get_domain_price`

To price a purchase, pass `domain`. To price a renewal, pass `domainId` instead. The answer carries `AmountCents`, the total in US cents for the whole term, which `buy_domain` and `renew_domain` must be given back as `amountCents`, `Years`, `MinYears` and `MaxYears`, the range of terms, `AllowedYears`, `Premium` and `PrivacyAvailable`.

`AllowedYears` lists the only terms a purchase can use when the extension sells a fixed set of them, and any other term is refused. It is `null` when every whole year from `MinYears` to `MaxYears` works, as it always is for a renewal. `PrivacyAvailable` is `false` when the extension offers no WHOIS privacy, so the registry may publish the registrant's details.

A domain is sold for 1 to 10 years, and some extensions only for a longer minimum term, which `MinYears` reports. A domain can be registered at most 10 years ahead, so a renewal's `MaxYears` shrinks as the time left on the domain grows, and once even `MinYears` would go past that ceiling the call is refused, because the domain cannot be renewed yet. Leave `years` out to price the shortest term allowed. Pricing a purchase is refused when the extension's registry needs extra details Modulify cannot collect yet, or when the name has characters other than a to z, 0 to 9 and hyphens.

For a purchase the answer also carries `RenewalAmountCents` and `RenewalYears`: what renewing the domain later costs today, in US cents, for `RenewalYears` years, the shortest renewal the extension allows. `RenewalAmountCents` is `null` when the registrar gave no renewal price, and both are `null` when you price a renewal.

For a purchase the answer also carries `Contact`, the registrant you entered on your last domain order in this workspace, filled in only for the workspace owner and `null` when you have not ordered one there. The tool tells the client to reuse it for `buy_domain` only after you confirm it. Every member can read a price, 20 times a minute per person. See [Pick a term](https://modulify.ai/docs/publish/buy-a-domain#pick-a-term).

## Request

Call it with a `POST` to `https://api.modulify.ai/v1/get_domain_price`, sending the inputs below as a JSON object. The token needs the `domains:read` scope.

It only reads and changes nothing, so retrying it is safe.

```bash
curl -X POST https://api.modulify.ai/v1/get_domain_price \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"workspaceId":"WORKSPACE_ID"}'
```

Over MCP, the same method is the [get_domain_price tool](https://modulify.ai/docs/mcp/bought-domains/get-domain-price).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `workspaceId` | string | Yes | The workspace that would pay. |
| `domain` | string | No | The domain to buy, such as `acme.com`, up to 253 characters. Leave it out when renewing. |
| `domainId` | string | No | The `_id` of a bought domain to renew, from `list_bought_domains`. Leave it out when buying. |
| `years` | integer | No | The term in whole years. Defaults to the shortest term allowed. |

## Response

Every call answers with the [JSON envelope](https://modulify.ai/docs/api/requests-and-responses#the-response) of `success`, `message`, `data`, `code` and `version`. `data` holds the result described above, and on a method that returns a total, `count` carries it. The [response headers](https://modulify.ai/docs/api/requests-and-responses#headers-on-every-method-call) carry the call's `X-Request-Id` and what is left of your per-minute budget in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. [Errors](https://modulify.ai/docs/api/errors) explains every status code a call can answer with.