DataHub Docs
DataHubLearnCommunity
  • 👋Welcome to Figment Docs
  • 🚩Introduction
    • 🚀Why Build on Web 3?
    • 💻What is DataHub?
  • 📖DataHub Guides
    • 📍DataHub Products
      • Transaction Search API
      • Staking API
    • 🏭DataHub Infrastructure
    • 🏁Get Started With DataHub
    • 🚨Quotas & Rate Limits
    • 💡Dashboard how-tos
      • Configuring CORS whitelist
  • 📚Network Documentation
    • 🔭Network Guide
    • 🅰️Arbitrum
      • 🎮RPC & REST API
    • 🏔️Avalanche
      • 🎮RPC & REST API
        • Avalanche Indexer API
    • 💠Binance Smart Chain
      • 🎮RPC & REST API
    • 💰Celo
      • 💼CELO Wallet
      • 🎮RPC & REST API
    • ➰Centrifuge
      • 🎮RPC & REST API
    • 🌌Cosmos
      • 🎮RPC & REST API
      • 🎊Enriched APIs
        • Transaction Search
        • Rewards API
    • 💎Ethereum
      • 🎮RPC & REST API
    • 🧊Fantom
      • 🎮RPC & REST API
    • 🐦Kusama
      • 🎮RPC & REST API
    • 📱Mina
      • 🎮RPC & REST API
        • Indexer API Documentation
        • Query Mina GraphQL API
    • 🌈NEAR
      • 🎮RPC & REST API
      • 🎊Enriched APIs
        • Indexer API
      • 💼NEAR Wallet
    • 🏝️Oasis
      • 🎮RPC & REST API
        • Oasis REST API
    • 🧪Osmosis
      • 🎮RPC & REST API
    • 🍡Polkadot
      • 🎮RPC & REST API
      • 🎊Enriched APIs
        • Indexer API
        • Transaction Search
    • ⛽Polygon (Matic)
      • 🎮RPC & REST API
    • 🔋Solana
      • 🎮RPC & REST API
    • 📚Extra Guides
      • Blockchain Fundamentals
      • Docker Setup for Windows
      • Troubleshooting CORS Errors on DataHub
      • 5XX Retry Logic Best Practices
        • 5XX Retry Logic Best Practices - NodeJS
        • 5XX Retry Logic Best Practices - Python
        • 5XX Retry Logic Best Practices - Ruby
        • 5XX Retry Logic Best Practices - Go
      • Setting up a fresh JavaScript Project with dotenv
      • Getting started with dotenv and .env files
      • Rust Learning Resources
      • Setup Solana BPF Toolchain on Windows
      • Figment Learn Pathway Troubleshooting
  • 🤔Other
    • 🧾Glossary
    • 🗳️Support
  • 🔗Terms & Conditions
    • Terms of Use
    • Terms & Conditions DataHub
    • Privacy Policy
    • Contributor Terms
Powered by GitBook
On this page
  • rewards
  • Example Request
  • Example Response

Was this helpful?

  1. Network Documentation
  2. Cosmos
  3. Enriched APIs

Rewards API

Learn how to use the Rewards API on Cosmos

PreviousTransaction SearchNextEthereum

Last updated 4 years ago

Was this helpful?

Test out our Rewards API today with !

rewards

GET https://cosmos--search.datahub.figment.io/rewards

Rewards enpoint allows users to query daily reward summaries for an account.

Request Body

Name
Type
Description

network

string

Network identifier (eg. cosmos)

chain_id

string

The chain id (eg. cosmoshub-4)

account

string

The account identifier

start_time

string

The start time in UTC. Daily reward summaries will be calculated in 24 hour periods from the start time.

end_time

string

The end time in UTC.

[
    {
    "start": 3997443,
    "end": 4009234,
    "time": "2020-11-08T02:00:00Z",
    "validator": "cosmosvaloper1lzhlnpahvznwfv4jmay2tgaha5kmz5qxerarrl",
    "rewards": [{
        "text": "14485183.076655587945uatom",
        "currency": "uatom",
        "numeric": 14485183076655587945173239,
        "exp": 18
    }]
    }
]
{
  "error": "Bad parameters sent"
}
{
  "error": "Something bad happened" 
}

Example Request

/rewards?network=cosmos&start_time=2021-04-01T02:00:00.00Z&chain_id=cosmoshub-4&end_time=2021-04-05T02:00:00.00Z&account=cosmos13axkauxjxulmvjyskppf8kxec56fyl96njm8qq&validators=cosmosvaloper1lzhlnpahvznwfv4jmay2tgaha5kmz5qxerarrl

Example Response

[{
  "start": 5699521,
  "end": 5711391,
  "time": "2021-04-01T02:00:00Z",
  "validator": "cosmosvaloper1lzhlnpahvznwfv4jmay2tgaha5kmz5qxerarrl",
  "rewards": [{
    "text": "14485183.076655587945uatom",
    "currency": "uatom",
    "numeric": 14485183076655587945173239,
    "exp": 18
  }]
}, {
  "start": 5711391,
  "end": 5723284,
  "time": "2021-04-02T02:00:00Z",
  "validator": "cosmosvaloper1lzhlnpahvznwfv4jmay2tgaha5kmz5qxerarrl",
  "rewards": [{
    "text": "14524615.642913129133uatom",
    "currency": "uatom",
    "numeric": 14524615642913129133835499,
    "exp": 18
  }]
}, {
  "start": 5723284,
  "end": 5735178,
  "time": "2021-04-03T02:00:00Z",
  "validator": "cosmosvaloper1lzhlnpahvznwfv4jmay2tgaha5kmz5qxerarrl",
  "rewards": [{
    "text": "14554430.583334477875uatom",
    "currency": "uatom",
    "numeric": 14554430583334477874950230,
    "exp": 18
  }]
}, {
  "start": 5735178,
  "end": 5747087,
  "time": "2021-04-04T02:00:00Z",
  "validator": "cosmosvaloper1lzhlnpahvznwfv4jmay2tgaha5kmz5qxerarrl",
  "rewards": [{
    "text": "14582108.999563571208uatom",
    "currency": "uatom",
    "numeric": 14582108999563571207321173,
    "exp": 18
  }]
}]

If you need help with this API or simply want to share with other builders, you can !

📚
🌌
🎊
DataHub
join our community today