This document provides detailed information about the available endpoints, including examples in Python and JavaScript.
The base URL for all API endpoints is:
<http://71.38.118.217:3001>
It is recommended to set up a CORS (Cross-Origin Resource Sharing) proxy server within your project to handle HTTP endpoints over the web (HTTPS). This approach provides several benefits:
To implement a CORS proxy server, you can use libraries like http-proxy-middleware
for Node.js or flask-cors
for Python.
Endpoint: /api/block-info
Description: Retrieves information about the latest block.
Response:
{
"height": 2722341,
"hash": "55f2fa748383aa57f69f5ad128516436f8a4dcb7f54f8d05a15b492b79cec575"
}
Python Example:
import requests
response = requests.get("<http://71.38.118.217:3001/api/block-info>")
data = response.json()
print(f"Block Height: {data['height']}")
print(f"Block Hash: {data['hash']}")
JavaScript Example: