Integrating with Yumi

API for price and volume

How to call

The base URL for the live REST-API is https://yumi-api-yrwav7ehrq-oa.a.run.app/statistics/.

The following endpoints are available. Find below a detailed description of each.

  • /events/all

  • /events/:amount

  • /events/:amount/:type

  • /24hVolume/:collectionId

  • /24hVolume/timeseries/:collectionId

  • /24hVolume/timeseries/top

  • /7dVolume/:collectionId

  • /floorPrice/24h/timeseries/:collectionId

Query the event lists

  • /events/all: list all events.

  • /events/:amount: list the last :amount number of events. :amount needs to be an integer >0. Example: /events/10

  • /events/:amount/:type: allows to define the type of event to be queried. Types can be as as defined here. Example: events/10/sold

Return type for all the event endpoints are as follows:

{  
  "_id": string,
  "index": number,
  "collectionId": string,
  "date": Date,
  "from": string,
  "to": string,
  "item": string,
  "price": number,
  "eventType": string,
}

Query the processed volume data

  • /24hVolume/:collectionId: returns the last 24h volume and change relative to the 24h before of the collection in :collectionId (string format of collection's canister ID). The trading volume is in ICP x 10^8 and the change in %. Example: /24hVolume/ah2fs-fqaaa-aaaak-aalya-cai. Returns an array of elements in the following json format

    {
      "collectionId": string,
      "tradingVolume": number,
      "change": number
    }
  • /7dVolume/:collectionId: returns the last 7d volume and change relative to the 7d before of the collection in :collectionId (string format of collection's canister ID). The trading volume is in ICP x 10^8 and the change in %. Example: /7dVolume/ah2fs-fqaaa-aaaak-aalya-cai. Returns an array of elements in the following json format

    {
      "collectionId": string,
      "tradingVolume": number,
      "change": number
    }
  • /24hVolume/timeseries/:collectionId: returns the daily trading volume as a timeseries of the collection defined in :collectionId (string format of collection's canister ID). The trading volume is in ICP x 10^8. Example: /24hVolume/timeseries/ah2fs-fqaaa-aaaak-aalya-cai. :collectionId can also be of argument all which will return the timeseries for all collections on Yumi as an array. Returns an array of elements in the following json format

    {
      "collectionId": string,
      "tradingVolume": [{
        "date": Date,
        "value": number
      }]
    }
  • /24hVolume/timeseries/top: returns the daily trading volume as a timeseries of the top five collections per day. The trading volume is in ICP x 10^8. For each day, an array of collections is returned, ordered by their trading volume. Additionally, each day contains an elememt called other which contains the sum of all other collections' trading volume on that day. Returns an array of elements in the following json format

    {
      "date": Date,
      "collection": [{
        "id": string,
        "volume": number
      }]
    }

Query floor price

  • /floorPrice/24h/timeseries/:collectionId: returns the daily floor price as a timeseries of the collection defined in :collectionId (string format of collection's canister ID). This includes trades on both primary and secondary market. The floor price is in ICP x 10^8. Example: /floorPrice/24h/timeseries/ah2fs-fqaaa-aaaak-aalya-cai. Returns an array of elements in the following json format

    {
      "date": string,
      "floorPrice": number
    }

Last updated