Explore and integrate with the Marscoin blockchain API
This API provides access to the Marscoin blockchain data, including blocks, transactions, and addresses. All endpoints return data in JSON format.
All API requests should be made to:
[ORIGIN]/api
To ensure service stability, API calls are limited to 10 requests per minute per IP address.
All errors are returned with appropriate HTTP status codes and error messages in JSON format.
Get a list of recent blocks with pagination support.
Name | Type | Required | Description |
---|---|---|---|
limit | number | No | Number of blocks to return (default: 10, max: 50) |
offset | number | No | Number of blocks to skip (default: 0) |
https://example.com/api/blocks?limit=5&offset=0
{ "blocks": [ { "hash": "00000000000000b345...", "height": 150232, "confirmations": 2, "size": 82345, "time": 1613207418, "txs": [ "2d6c0de71d4d9345..." ] }, // More blocks... ] }
Get detailed information about a specific block by hash.
Name | Type | Required | Description |
---|---|---|---|
hash | string | Yes | The hash of the block |
https://example.com/api/block/00000000000000b34589247492...
{ "hash": "00000000000000b345...", "height": 150232, "confirmations": 2, "size": 82345, "time": 1613207418, "merkleroot": "97f1a53305b....", "tx": [ "2d6c0de71d4d9345..." ], "bits": "1d00fff...", "difficulty": 23.45, "previousblockhash": "0000000000000..." }
Get block hash by height.
Name | Type | Required | Description |
---|---|---|---|
height | number | Yes | The height of the block in the blockchain |
https://example.com/api/block-index/150232
{ "blockHash": "00000000000000b345..." }
To ensure service stability and availability for all users, the API implements the following rate limits:
Rate limit information is included in the response headers:
X-RateLimit-Limit: 10 X-RateLimit-Remaining: 9 X-RateLimit-Reset: 1613207478
If you exceed the rate limit, you will receive a 429 Too Many Requests response.
All API errors are returned with appropriate HTTP status codes and a JSON error object.
// Example error response (404 Not Found) { "error": "Transaction not found" } // Example error response (400 Bad Request) { "error": "Invalid transaction hex" } // Example error response (429 Too Many Requests) { "error": "Rate limit exceeded, retry after 60 seconds" }
Status Code | Description |
---|---|
400 Bad Request | Invalid request parameters |
404 Not Found | Resource not found |
429 Too Many Requests | Rate limit exceeded |
500 Internal Server Error | Server error |
503 Service Unavailable | Server temporarily unavailable |