REST API Overview
The Artha Chain REST API provides a comprehensive set of endpoints for interacting with the blockchain. This API follows RESTful principles and uses standard HTTP methods and status codes.
Base URL
All API endpoints are relative to the base URL:
https://api.arthachain.com/v1
Authentication
Most endpoints require authentication using an API key. Include your API key in the X-API-Key
header:
curl -H "X-API-Key: your-api-key" https://api.arthachain.com/v1/endpoint
Rate Limiting
API requests are subject to rate limiting. The current limits are:
- 100 requests per minute for standard endpoints
- 1000 requests per minute for high-priority endpoints
Rate limit headers are included in all responses:
X-RateLimit-Limit
: Maximum requests per windowX-RateLimit-Remaining
: Remaining requests in current windowX-RateLimit-Reset
: Time when the rate limit resets
Response Format
All responses are returned in JSON format with the following structure:
{
"success": true,
"data": {
// Response data
},
"error": null
}
Error Handling
Errors are returned with appropriate HTTP status codes and a JSON response:
{
"success": false,
"data": null,
"error": {
"code": "ERROR_CODE",
"message": "Human readable error message"
}
}
Common Error Codes
Code | Description |
---|---|
INVALID_API_KEY | The provided API key is invalid |
RATE_LIMIT_EXCEEDED | Too many requests in the current time window |
INVALID_PARAMETER | One or more parameters are invalid |
RESOURCE_NOT_FOUND | The requested resource does not exist |
INTERNAL_ERROR | An internal server error occurred |
Versioning
The API is versioned using the URL path. The current version is v1. When breaking changes are introduced, a new version will be released.
SDK Support
We provide official SDKs for popular programming languages:
// JavaScript SDK // Python SDK // Go SDK // Rust SDK
Getting Started
Next Steps
// Authentication // Endpoints // Rate Limits