RapidNode Docs
Back to WebsiteX/Twitter
  • Welcome
    • What is RapidNode?
  • Solana RPC Nodes
    • RapidNode RPCs Overview
    • Dedicated Nodes
      • Getting Started with Dedicated Nodes
    • Dedicated Staked Connections
    • Common Error Codes
  • RPC
    • HTTP
      • getAccountInfo
      • getBalance
      • getBlock
      • getBlockCommitment
      • getBlockHeight
      • getBlockProduction
      • getBlockTime
      • getBlocks
    • Websocket
  • Data Streaming
    • gRPC
    • Webhooks
  • Solana APIs
    • Priority Fee API
    • Enhanced Transaction API
    • Token Metadata API
  • Guides
    • RPC Proxy — Protect Your Keys
    • Sending Transactions on Solana
  • Resources
    • RapidNode Blog
    • SDKs
    • Transaction Types
    • Status Page
Powered by GitBook
On this page
  1. RPC
  2. HTTP

getBlockTime

Returns the estimated production time of a block.

PreviousgetBlockProductionNextgetBlocks

Last updated 4 months ago

getBlockTime

const response = await fetch('https://mainnet.rapidnode-rpc.com/?api-key=<api-key>', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "jsonrpc": "2.0",
      "id": "1",
      "method": "getBlockTime",
      "params": [
        5
      ]
    }),
});
const data = await response.json();
{
  "jsonrpc": "2.0",
  "id": "text",
  "result": 1574721591
}
https://mainnet.rapidnode-rpc.com/?api-key=<api-key>