Developer Portal

Build on GMAChain. Read-only REST endpoints power this explorer, a JSON-RPC interface talks directly to validator nodes, and a WebSocket stream pushes blocks and transactions in real time.

REST Endpoints

GET/v1/statsLive network statistics
GET/v1/blocksList latest blocks
GET/v1/blocks/{height}Get a block by height
GET/v1/transactions/{hash}Get a transaction by hash
GET/v1/accounts/{address}Get account / wallet details
GET/v1/accounts/{address}/transactionsAccount transaction history
GET/v1/validatorsList the PoA validator set
GET/v1/tgx/poolsTGX liquidity pools
GET/v1/tgx/swapsRecent TGX swaps
GET/v1/richlistTop GMA holders
GET/v1/treasury/walletsTreasury wallets & balances
GET/v1/burnsBurn event history
GET/v1/unlocksVesting & unlock calendar
GET/v1/search?q=Universal search resolver

Base URLs

REST API

https://api.gmascan.io/v1

JSON-RPC

https://rpc.gmachain.network

WebSocket Stream

wss://api.gmascan.io/v1/stream

No API key is required for read-only endpoints. Rate limits apply per IP; contact the foundation for elevated limits.

cURL

bash
curl https://api.gmascan.io/v1/blocks?limit=5 \
  -H "Accept: application/json"

JavaScript

javascript
const res = await fetch("https://api.gmascan.io/v1/accounts/gma1...", {
  headers: { Accept: "application/json" },
})
const account = await res.json()
console.log(account.balance, account.txCount)

Python

python
import requests

res = requests.get(
    "https://api.gmascan.io/v1/validators",
    headers={"Accept": "application/json"},
)
validators = res.json()
print(len(validators), "active validators")

JSON-RPC

bash
curl -X POST https://rpc.gmachain.network \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "gma_getBlockByHeight",
    "params": [18452900],
    "id": 1
  }'

Live WebSocket Stream

javascript
const ws = new WebSocket("wss://api.gmascan.io/v1/stream")

ws.onmessage = (event) => {
  const msg = JSON.parse(event.data)
  if (msg.channel === "blocks") console.log("new block", msg.data.height)
  if (msg.channel === "transactions") console.log("new tx", msg.data.hash)
}

ws.onopen = () => {
  ws.send(JSON.stringify({ type: "subscribe", channels: ["blocks", "transactions"] }))
}

Subscribe to blocks and transactions channels for the same live feed that powers this explorer's dashboard.