archethic-foundation / fetch-api-service

An API server that provides various offchain resources
1 stars 2 forks source link

Archethic FetchApiService (FAS)

An API server that exposes various off-chain resources such as cryptoassets prices.

Envs

Quotes

Cryptoassets are identified by Unified Cryptoasset ID (UCID). Available cryptoassets in this API:

Providers requested:

Latest

Return the latest available quotes from given cryptoassets. The result is an aggregate of multiple providers. The values are cached for a few minutes.

GET /api/v1/quotes/latest[?ucids=6887,1,1027,3890,1839]

{
  "1": 46886.44559469423,
  "1839": 301.88655780971703,
  "1027": 2263.032408397367,
  "3890": 0.790940929057782,
  "6887": 0.04767200156279931
}

History

Return the historical values (market cap, price and volume) from given cryptoasset. The result is an aggregate of multiple providers. The result is a list of pairs [timestamp, value]. The values are cached for a few minutes.

Available intervals:

GET /api/v1/quotes/history?ucid=6887&interval=hourly

{
  "market_caps":[
    [1724310118423,0.0],
    [1724310423772,0.0],
    ...
  ],
  "prices":[
    [1724310118423,0.016558402243090357],
    [1724310423772,0.016562097651212856],
    ...
  ],
  "total_volumes":[
    [1724310118423,2344.4700086016405],
    [1724310423772,2344.993613232555],
    ...
  ]
}

Upgrade

MIX_ENV=prod mix release
service archethic-fas restart