Skip to main content

Hands-On for Beginners

API Key

If you have not already done so, check out the Quick Start Guide to learn how to get your API Key

With an API Key in hand, the power of the Staking Data API lies before you. But perhaps terms like JSON or GraphQL still feel like jargon, or worse, instill a sense of fear inside of you.

Fear not!

This section is crafted specially for you, breaking down these concepts in a user-friendly manner. In this section, we will guide you through the labyrinth of tech speak and have you querying data in no time.

API Playground

Designed specifically for those who want to get their hands dirty asap, the Staking Rewards Playground guides you along the 7 Steps from novice to Staking Data Expert.

Try it for yourself

Head over to the Playground now to take your first 7 Steps with the Staking Rewards Staking Data API.

Find more detailed information on each of the queries below.

query Step1 {
assets(limit: 10) {
id
slug
logoUrl
metrics(where: {metricKeys: ["reward_rate"]}, limit: 1) {
defaultValue
}
}
}
  • In the above query, we are querying for 10 assets as can be seen by the limit being set to 10.
isActive

isActive is by default always true, even when you do not include where: {isActive: True} in your query.

  • The query retrieves four fields for each asset: id, slug, logoUrl, and metrics.

  • The metrics field provides an array of metrics associated with each asset.

showAll Metrics

showAll is by default set to False.
This means that if you query metrics without explicitly including showAll:true you will only receive metrics which are deemed standard; such as reward_rate, price, etc.
For the majority of users we recommend to not use showAll:true to avoid overusing your credits.

  • We can specify conditions for the metrics query. In this case, query up to 1 metric limit: 1 with metricKey set to 'reward_rate'.
    metricKeys:["reward_rate"]

  • Try this query out yourself in the Playground