MacOS Chain Developer APIs
Programmatic access to MacOS Chain blockchain data.
Compatible with Etherscan-style API format.
Getting Started
All API calls use the base URL:
https://macosscan.codeupp.xyz/api/v1?module=MODULE&action=ACTION&apikey=YOUR_KEYRate Limits by Plan
Free1/sec · 10K/day
Starter5/sec · 100K/day
Growth15/sec · 500K/day
Pro30/sec · 2M/day
📦
Etherscan-Compatible
Drop-in replacement for any app using Etherscan API format
⚡
Real-time Data
Powered by PostgreSQL indexer, updated every block (~2s)
🔒
API Key Auth
Pass
?apikey= or X-API-Key headerResponse Format & Error Codes
SUCCESS RESPONSE
{ "status": "1", "message": "OK", "result": ... }ERROR RESPONSE
{ "status": "0", "message": "Error reason", "result": "" }| HTTP Code | Meaning |
|---|---|
200 | Success (check status field) |
400 | Missing required parameter |
401 | Invalid or missing API key |
429 | Rate limit exceeded |
500 | Server error |
AccountModule: account
GETGet MCOS Balance
GETGet Normal Transactions
BlockModule: block
GETGet Block Reward
GETGet Block Countdown
GETGet Block by Timestamp
TransactionModule: transaction
GETGet Transaction Status
GETGet Transaction Info
StatsModule: stats
GETGet Total Transactions
GETGet Daily Transactions
GETGet Gas Estimate
Code Examples
JAVASCRIPT (fetch)
const apikey = 'YOUR_API_KEY';
const addr = '0xYourAddress';
const res = await fetch(
`https://macosscan.codeupp.xyz/api/v1?module=account`
+ `&action=balance`
+ `&address=${addr}`
+ `&apikey=${apikey}`
);
const data = await res.json();
// data.result = balance in wei
const mcos = data.result / 1e18;
console.log(`Balance: ${mcos} MCOS`);PYTHON (requests)
import requests
API_KEY = 'YOUR_API_KEY'
BASE = 'https://macosscan.codeupp.xyz/api/v1'
r = requests.get(BASE, params={
'module': 'account',
'action': 'txlist',
'address': '0xYourAddress',
'page': 1,
'offset': 25,
'apikey': API_KEY
})
data = r.json()
for tx in data['result']:
print(tx['hash'], tx['value'])