Cambrian Latest Block Number and Time API

By Cambrian Network solana

GET /api/v1/solana/latest-block

Latest Block Number and Time

This endpoint returns the latest block number and block time for the Solana blockchain. It provides real-time information about the most recently processed block, including the block number, Unix timestamp, and UTC timestamp.

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://opabinia.cambrian.network/api/v1/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 demonstrates how to retrieve the current latest block information from Solana.

curl -X GET "https://opabinia.cambrian.network/api/v1/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": [
    [
      392362393,
      1767967687,
      "2026-01-09T14:08:07Z"
    ]
  ],
  "rows": 1
}

The response shows the latest block number 392362393, which was processed at Unix timestamp 1767967687 (2026-01-09T14:08:07Z).

2. Monitor Blockchain Health

This example shows how to use the latest block endpoint for blockchain health monitoring.

curl -X GET "https://opabinia.cambrian.network/api/v1/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": [
    [
      392362393,
      1767967687,
      "2026-01-09T14:08:07Z"
    ]
  ],
  "rows": 1
}

You can compare the block timestamp with the current time to measure blockchain processing latency and ensure the network is functioning properly.

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://deep42.cambrian.network/api/v1/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://deep42.cambrian.network/api/v1/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–5 automatically.

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


Related Endpoints

  • /api/v1/solana/price-current - Retrieves the latest available USD price for a given Solana token program address
  • /api/v1/solana/price-unix - Retrieve historical price data for a specified Solana token at the nearest hour to a specific Unix timestamp
  • /api/v1/solana/pool-transactions-time-bounded - Get detailed transaction data for any SPL token across major Solana DEXs with precise Unix timestamp filtering
  • /api/v1/solana/ohlcv/token - Retrieve Open, High, Low, Close, and Volume data for any SPL token
  • /api/v1/solana/tokens/holders-over-time - Returns a list of accounts holding a specific token providing snapshots at specified block intervals