---
updatedAt: 2025-11-11T21:42:08.000Z
agentTools:
  projectIndex: https://domains.opensrs.guide/llms.txt
---

# get_price

Queries the price of a domain, and can be used to determine the cost of a billable transaction for any TLD. A returned price for a given domain does not guarantee the availability of the domain, but indicates that the requested action is supported by the system and calculates the cost to register the domain (if available).

## Request parameters

#### Standard request parameters

* **action** = get\_price
* **object** = domain

### Request attributes

Parameters within the **attributes** associative array are described below:

| Parameter    | Obligation | Definition/Value                                                                                                            |
| :----------- | :--------- | :-------------------------------------------------------------------------------------------------------------------------- |
| domain       | Required   | The domain to be queried.                                                                                                   |
| period       | Required   | The desired registration period, default is **1**.                                                                          |
| all\_periods | Optional   | Return prices for all available periods. Accepted values are, 1 or 0.                                                       |
| reg\_type    | Optional   | The type of registration.<br/><br/>Allowed values are:<br/>**new**—(default)<br/>**renewal**<br/>**transfer**<br/>**trade** |

***

## Response parameters

#### Standard response parameters

* **action** = reply
* **object** = domain
* is\_success = Boolean indicating success or failure of the request.
* response\_code = Response code indicating outcome of the request.
* response\_text = Message describing the outcome of the request.

### Response attributes

If the request is successful, the **attributes** associative array may include the following:

| Parameter                | Obligation                        | Definition/Value                                                                                                                                                                                                          |
| :----------------------- | :-------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| price                    | Always returned                   | The price of the queried domain.<br/><br/>This value includes the OpenSRS price and the ICANN fee.                                                                                                                        |
| prices                   | Returned if **all\_periods=1**    | An array containing the prices for all available periods.<br/><br/>This value includes the OpenSRS price and the ICANN fee.                                                                                               |
| is\_registry\_premium    | Returned only for premium domains | Indicates whether the domain is a registry premium.                                                                                                                                                                       |
| registry\_premium\_group | Returned only for premium domains | Indicates the type of registry premium domain, for more information, see [our help article](https://help.opensrs.com/hc/en-us/articles/218557198-Registry-premium-domains-guide-#h_80adffb9-b273-4baf-b04e-8aa4c5702d90). |

> 📘 Note
>
> A value for is\_registry\_premium will only be returned if:<br/><br/>1. The domain is registry premium<br/>2. The registry premium tier into which the domain falls is enabled in the reseller's account.<br/><br/>3. The accurate price for the domain will always be returned, regardless of whether or not the premium tier into which the domain falls is enabled.

***

## Examples

### Example 1: Standard domain

```xml Request
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<OPS_envelope>
    <header>
        <version>0.9</version>
    </header>
    <body>
        <data_block>
            <dt_assoc>
                <item key="protocol">XCP</item>
                <item key="action">GET_PRICE</item>
                <item key="object">DOMAIN</item>
                <item key="attributes">
                    <dt_assoc>
                        <item key="domain">example.com</item>
                        <item key="period">1</item>
                        <item key="reg_type">new</item>
                    </dt_assoc>
                </item>
            </dt_assoc>
        </data_block>
    </body>
</OPS_envelope>
```
```xml Response
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<OPS_envelope>
    <header>
        <version>0.9</version>
    </header>
    <body>
        <data_block>
            <dt_assoc>
                <item key="protocol">XCP</item>
                <item key="action">REPLY</item>
                <item key="object">DOMAIN</item>
                <item key="is_success">1</item>
                <item key="response_code">200</item>
                <item key="response_text">Command Successful</item>
                <item key="attributes">
                    <dt_assoc>
                        <item key="price">20.2</item>
                    </dt_assoc>
                </item>
            </dt_assoc>
        </data_block>
    </body>
</OPS_envelope>
```

### Example 2: Premium domain

```xml Request
<?xml version='1.0' encoding="UTF-8" standalone="no" ?>
<!DOCTYPE OPS_envelope SYSTEM "ops.dtd">
<OPS_envelope>
 <header>
  <version>0.9</version>
  </header>
 <body>
  <data_block>
   <dt_assoc>
    <item key="protocol">XCP</item>
    <item key="object">DOMAIN</item>
    <item key="action">GET_PRICE</item>
    <item key="attributes">
     <dt_assoc>
      <item key="domain">restful.blue</item>
      <item key="period">1</item>
      <item key="reg_type">new</item>
     </dt_assoc>
    </item>
   </dt_assoc>
  </data_block>
 </body>
</OPS_envelope>
```
```xml Response
<?xml version='1.0' encoding="UTF-8" standalone="no" ?>
<!DOCTYPE OPS_envelope SYSTEM "ops.dtd">
<OPS_envelope>
 <header>
  <version>0.9</version>
  </header>
 <body>
  <data_block>
   <dt_assoc>
    <item key="protocol">XCP</item>
    <item key="object">DOMAIN</item>
    <item key="response_text">Command Successful</item>
    <item key="action">REPLY</item>
    <item key="attributes">
     <dt_assoc>
      <item key="registry_premium_group">2</item>
      <item key="price">83.99</item>
      <item key="is_registry_premium">1</item>
     </dt_assoc>
    </item>
    <item key="response_code">200</item>
    <item key="is_success">1</item>
   </dt_assoc>
  </data_block>
 </body>
</OPS_envelope>
```
```xml Response for all_periods=1
<?xml version='1.0' encoding="UTF-8" standalone="no" ?>
<!DOCTYPE OPS_envelope SYSTEM "ops.dtd">
<OPS_envelope>
 <header>
  <version>0.9</version>
  </header>
 <body>
  <data_block>
   <dt_assoc>
    <item key="protocol">XCP</item>
    <item key="object">DOMAIN</item>
    <item key="response_text">Command Successful</item>
    <item key="action">REPLY</item>
    <item key="attributes">
     <dt_assoc>
      <item key="registry_premium_group">2</item>
      <item key="price">83.99</item>
      <item key="is_registry_premium">1</item>
      <item key="prices">
       <dt_assoc>
        <item key="6">503.93</item>
        <item key="3">251.96</item>
        <item key="7">587.92</item>
        <item key="9">755.89</item>
        <item key="2">167.98</item>
        <item key="8">671.90</item>
        <item key="1">83.99</item>
        <item key="4">335.95</item>
        <item key="10">839.88</item>
        <item key="5">419.94</item>
       </dt_assoc>
      </item>
     </dt_assoc>
    </item>
    <item key="response_code">200</item>
    <item key="is_success">1</item>
   </dt_assoc>
  </data_block>
 </body>
</OPS_envelope>
```