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:

'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:

{
      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:

      

  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
          },
        page: 3,
        itemsPerPage: 50,
        sort: "time"
        }
        headers: {
        'x-api-key': API_KEY,
      });

POST Get List of Ordinals

Get List of Ordinals

POST https://api.ordinalsbot.com/marketplace/get-listing

API Key is required in the header:

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

Request Body

NameTypeDescription

filter

Object

An object with status or any other fields to filter example { "status":"Sold" }

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

{
      results: [
                {
                    "_id": "7354826c46a5856b972795d7",
                    "ordinalId": "8dc4e.....6ce70260i0",
                    "price": 12345,
                    "sellerPaymentAddress": "3Ny......yc4q",
                    "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="
                },
                {
                    "_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
}

Last updated