Cambrian Latest Block Number and Time API

By Cambrian Network solana

GET /api/v1/solana/latest-block

Latest Block Number and Time

Overview

This endpoint returns the latest block number and block time for the Solana blockchain, including the Unix timestamp and UTC timestamp of the most recently processed block.

Business Value

  • Real-time Monitoring: Track the current state of the Solana blockchain with up-to-date block information
  • Synchronization: Ensure applications are synchronized with the latest blockchain state
  • Latency Measurement: Calculate blockchain processing delays by comparing block times with current time
  • Health Checks: Monitor blockchain network health and block production rates
  • Data Pipeline: Use as a reference point for blockchain data processing and ETL operations

Endpoint Details

URL:

https://api.cambrian.org/solana/latest-block

Method: GET
Authentication: Required via X-API-Key header

Query Parameters

Parameter Type Required Default Description
- - - - No parameters required

Response Field Descriptions

Response Field Type Description
blockNumber UInt64 The latest block number on Solana
blockUnixTime UInt32 Unix timestamp of the latest block
blockUTCTime String UTC timestamp of the latest block in ISO 8601 format

Examples

1. Get Latest Block Information

This example retrieves the current latest block information from Solana.

curl -X GET "https://api.cambrian.org/solana/latest-block" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response:

[
  {
    "columns": [
      {
        "name": "blockNumber",
        "type": "UInt64"
      },
      {
        "name": "blockUnixTime",
        "type": "UInt32"
      },
      {
        "name": "blockUTCTime",
        "type": "String"
      }
    ],
    "data": [
      [
        437259914,
        1785882554,
        "2026-08-04T22:29:14Z"
      ]
    ],
    "rows": 1
  }
]

The response returns block number 437259914, processed at Unix timestamp 1785882554 (2026-08-04T22:29:14Z).

2. Monitor Blockchain Health

This example uses the latest block endpoint for health monitoring, polling it and comparing the returned block time against the current wall-clock time.

curl -X GET "https://api.cambrian.org/solana/latest-block" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response:

[
  {
    "columns": [
      {
        "name": "blockNumber",
        "type": "UInt64"
      },
      {
        "name": "blockUnixTime",
        "type": "UInt32"
      },
      {
        "name": "blockUTCTime",
        "type": "String"
      }
    ],
    "data": [
      [
        437259914,
        1785882554,
        "2026-08-04T22:29:14Z"
      ]
    ],
    "rows": 1
  }
]

Comparing blockUnixTime to the current time lets you measure processing latency and confirm the network is producing blocks as expected.

x402 Payment Option

This endpoint supports pay-per-use access via the x402 payment protocol (v2): pay $0.05 USDC per request using blockchain micropayments. No API key required.

Quick Start (TypeScript)

npm install @x402/fetch @x402/evm viem
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";

const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
const client = new x402Client();
client.register("eip155:*", new ExactEvmScheme(signer));

const fetchWithPayment = wrapFetchWithPayment(fetch, client);
const response = await fetchWithPayment(
  "https://x402.cambrian.org/solana/latest-block"
);
const data = await response.json();

Quick Start (Python)

pip install "x402[httpx]"
import asyncio, os
from eth_account import Account
from x402 import x402Client
from x402.http.clients import x402HttpxClient
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client

async def main():
    client = x402Client()
    account = Account.from_key(os.getenv("EVM_PRIVATE_KEY"))
    register_exact_evm_client(client, EthAccountSigner(account))

    async with x402HttpxClient(client) as http:
        response = await http.get("https://x402.cambrian.org/solana/latest-block")
        print(response.json())

asyncio.run(main())

Payment Flow

  1. Send a normal request to the endpoint (no API key needed)
  2. Server returns 402 Payment Required with payment details
  3. The x402 SDK automatically signs a payment authorization with your wallet
  4. The SDK resubmits the request with the signed payment
  5. Server verifies payment and returns the API response

The x402 SDK handles steps 2 through 5 automatically.

Network: Base (chain ID 8453) | Currency: USDC | Price: $0.05 per request


Related Endpoints

  • /solana/price-current - Retrieves the latest available USD price for a given Solana token program address
  • /solana/price-multi - Retrieves the latest available USD prices for multiple Solana token program addresses (comma-separated)
  • /solana/price-unix - Retrieve historical price data for a specified Solana token at the nearest hour to a specific Unix timestamp
  • /solana/pool-transactions-time-bounded - Get detailed transaction data for any SPL token across major Solana DEXs with precise Unix timestamp filtering
  • /solana/ohlcv/token - Retrieve Open, High, Low, Close, and Volume data for any SPL token