# getAuctionPrice()

```typescript
/**
   * Get the auction price of the Collective Portrait.
   *
   * @remarks
   * The auction price is the price of the Collective Portrait for 1 year.
   * If years > 1, the function will only return the price of the Collective Portrait for 1 year + the price of the Collective Portrait for the remaining years.
   * If the Collective Portrait is not up for auction, this function will throw an error.
   *
   * @param {CollectivePortraitName | number} identity - The name of the Collective Portrait that the user would like to get the auction price for.
   * @param {number} years - The number of years that the user would like to register the Collective Portrait for.
   * @returns {number} - The auction price of the Collective Portrait.
   * @beta
   * @async
   */
  getAuctionPrice(
    identity: CollectivePortraitName | number,
    years: number,
  ): number {
    // Requires the auction to be active
    if (!this.isAuction(identity)) {
      throw new Error('Auction is not active');
    }
    return this.getPrice(identity, years);
  }
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ryan-44.gitbook.io/portrait/portrait-sdk/collective-portraits/read/getauctionprice.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
