> For the complete documentation index, see [llms.txt](https://docs.ordinalsbot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ordinalsbot.com/marketplace-1/get-list-of-ordinals.md).

# Get List of Ordinals

This end point returns a list of ordinals. By default it returns all ordinals available for sale. The returned list of ordinals can also be filtered by status. The following status values are available:<br>

```typescript
'Sold', // Ordinals that have been sold
'Active', // Ordinals still available for sale
'Inactive', // Ordinals that have been marked as not available for sale by admin
'Pending Buyer Confirmation', // Ordinals where buyer has initiated purchase but not completed the sign and broadcast part of the process
'Pending Seller Confirmation', // Ordinals where seller has initiated listing but not completed the sign and save part of the process
```

Pagination and sorting options can be specified by adding `itemsPerPage` , `page` and `sort`\
values in the request body. By default results are sorted by listing time.\
Response provides an array of ordinals as well as information on current page and total ordinals for the specified search filter.\
\
Response structure:

```typescript
{
      results: [{},{},{},{}], // array of Ordinal listings
      count: 0, // number of Ordinals in the current results array
      currentPage: page, // current page number
      totalPages: 0, // total pages that can be returned for the current search results
      totalItems: 0 // total items in the database for the current search results
}
```

Here's an example of a call to get the 3rd page of all sold Ordinals sorted by time:

<pre class="language-javascript"><code class="lang-javascript">      

  const LISTING_STATUS = {
    sold: 'Sold',
    active: 'Active',
    inactive: 'Inactive',
    pending_buyer_confirmation: 'Pending Buyer Confirmation',
    pending_seller_confirmation: 'pending Seller Confirmation',
  }


      // Call /get-listing end point to get all Ordinals available for sale
      // by default only available ordinals are returned
      const { data } = await axios({
        method: 'post'
        url: 'https://api.ordinalsbot.com/marketplace/get-listing',
        headers: {
        'x-api-key': API_KEY,
      });


      // Call /get-listing end point to get all Ordinals that have been sold
      const { data } = await axios({
        method: 'post'
        url: 'https://api.ordinalsbot.com/marketplace/get-listing',
        data: {
          filter: {
            status: LISTING_STATUS.sold
          },
<strong>        page: 3,
</strong>        itemsPerPage: 50,
        sort: "time"
        }
        headers: {
        'x-api-key': API_KEY,
      });

</code></pre>

### `POST` Get List of Ordinals

## Get List of Ordinals

<mark style="color:green;">`POST`</mark> `https://api.ordinalsbot.com/marketplace/get-listing`

API Key is required in the header:

`headers: { 'x-api-key': '<YOUR_API_KEY>', ...otherHeaders }`

#### Request Body

| Name         | Type   | Description                                                                                                                                                                   |
| ------------ | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| filter       | Object | <p>An object with status or any other fields to filter<br>example<br>{ "status":"Sold" }</p>                                                                                  |
| page         | Number | The page number in the list of pages to return by default the first page is returned                                                                                          |
| itemsPerPage | Number | The number of Ordinals to return in each page, this defaults to 100                                                                                                           |
| sort         | String | The sort field. This can be '`time`' or '`date`' to sort by listing time. this can also by any other field in the Ordinal data like '`price`' or '`sellerPaymentAddress`' etc |

{% tabs %}
{% tab title="200: OK " %}

<pre class="language-json"><code class="lang-json">{
      results: [
                {
                    "_id": "7354826c46a5856b972795d7",
                    "ordinalId": "8dc4e.....6ce70260i0",
                    "price": 12345,
                    "sellerPaymentAddress": "3Ny......yc4q",
                    "sellerOrdinalPublicKey": "4fa4.....118fad4e476541",
<strong>                    "status": "Active",
</strong>                    "sellerOutputValue": 21111,
                    "ordinalUtxoTxId": "3362....61449ef",
                    "ordinalUtxoVout": 0,
                    "marketPlaceMakerFee": 0,
                    "marketPlaceTakerFee": 0,
                    "platformMakerFee": 1000,
                    "platformTakerFee": 1000,
                    "__v": 0,
                    "signedListingPSBT": "cHNid......1rARj61OR2VBAAA="
                },
                {
                    "_id": "1835526c46a5856b972795d7",
                    "ordinalId": "1dc4e.....6ce70260i0",
                    "price": 12345,
                    "sellerPaymentAddress": "3Ny......yc2a",
                    "sellerOrdinalPublicKey": "4fa4.....118fad4e476541",
                    "status": "Active",
                    "sellerOutputValue": 21111,
                    "ordinalUtxoTxId": "3362....61449ef",
                    "ordinalUtxoVout": 0,
                    "marketPlaceMakerFee": 0,
                    "marketPlaceTakerFee": 0,
                    "platformMakerFee": 1000,
                    "platformTakerFee": 1000,
                    "__v": 0,
                    "signedListingPSBT": "cHNid......1rARj61OR2VBAAA="
                },
            ],
      count: 2, // number of Ordinals in the current results array
      currentPage: 3, // current page number
      totalPages: 3, // total pages that can be returned for the current query
      totalItems: 102 // total items for the current search query
}


</code></pre>

{% endtab %}

{% tab title="500: Internal Server Error " %}

```json
{
    status: 'error',
    error: 'error reason'
}
```

{% endtab %}
{% endtabs %}
