API /categories/earn/rates

computer

The /categories/earn/rates API is used to retrieve the BEST rates for a specified set of coins.

This API would be useful for building a 'best rates' table that displayed the organizations offering the highest reward rate for various assets.

Reward rates can be returned for saving, staking and yield farming products.

Requests for this API should be made to:

GEThttps://coinpublishers.com/v1/api/categories/earn/rates

Remember to pass your API key in order to authenticate.

Request Parameters

The following are the parameters that can be passed to customise the response:

activities
string

The category of products that should be returned.

Possible values: SavingStakingYield Farming

Default: All

category* required
string

The category for the set of data to be returned. Possible values:

cmc_top_10Top 10 Coin Market Cap assets

cmc_top_20Top 20 Coin Market Cap assets

data_management_coins

defi_coins

derivative_coins

exchange_coins

file_storage_coins

gaming_coins

stablecoins

privacy_coins

web3

terms
string

The minimum duration for which the deposited coins must remain.
- Flexible products can be withdrawn at any time.
- Fixed products are subject to a minimum deposit period.

Possible values: FixedFlexible

Default: All

The following is a example of a Curl request to the API:

curl
-H "x-cp_api_key: b54bcf4d-1bca-4e8e-9a24-221233d462c"
-H "Accept: application/json"
-d "category=cmc_top_10&activity=Saving&terms=Flexible"
-G https://coinpublishers.com/api/v1/categories/earn/rates

Responses

The following is a list of the possible responses:

The following is an example of a successful response:

{
  "data": [
    {
      "activity": "Saving",
      "deposits": [
        {
          "symbol": "BTC",
          "name": "Bitcoin"
        }
      ],
      "rewards": [
        {
          "symbol": "BTC",
          "name": "Bitcoin"
        }
      ],
      "last_updated": "2022-08-16T01:01:14",
      "organization": "OKEx",
      "model": "CeFi",
      "rate": 500,
      "terms": {
        "durationInDays": 5,
        "type": "Fixed"
      }
    }
  ],
  "status": {
    "error_code": 0,
    "error_message": "",
    "current_page": 1,
    "pages": 6,
    "result": "OK",
    "timestamp": "2022-08-16T11:32:23"
  }
}

The following is an example of a failed response:

{
  "status": {
    "error_code": 401,
    "error_message": "Unauthorized access - please check your API key",
    "result": "NOK",
    "timestamp": "2018-06-06T07:52:27.273Z"
  }
}

Response Schema

The following is a description of the fields that can be returned in a response:

activity
string

The type of earning product.

Possible values: SavingStakingYield Farming

deposits
array

An array of objects that indicate what assets have to be deposited in order to earn the reward.

namestringE.g. "Bitcoin"
symbolstringE.g. "BTC"

This is normally just one asset but some yield farming products require depositors to provide two assets.

rewards
array

An array of objects indicating how the reward will be paid.

namestringE.g. "Bitcoin"
symbolstringE.g. "BTC"

This is typically just one asset but some yield farming products may pay a reward in two assets.

last_updated
timestamp
The date/time when the response was generated
organization
object

An object related to the organization providing the product.

namestring
model
string

The classification of the product.

Possible values: CeFiDeFiHybrid

rate
number
The rate of interest.
terms
object

An object describing whether the product is a flexible (withdraw anytime) or fixed term (minimum deposit duration).

typestring possible values: FixedFlexible

durationInDays number used to indicate the minimum number of days that a fixed term product must be deposited

error_code
number
HTTP error code - 200 if successful
error_message
string
The reason why the request failed
current_page
number
The current page of the paginated results.
pages
number
The number of pages that the response is paginated across.
result
string
"OK" if response successful
timestamp
timestamp
Current timestamp