Skip to main content

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 window
  • X-RateLimit-Remaining: Remaining requests in current window
  • X-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​

CodeDescription
INVALID_API_KEYThe provided API key is invalid
RATE_LIMIT_EXCEEDEDToo many requests in the current time window
INVALID_PARAMETEROne or more parameters are invalid
RESOURCE_NOT_FOUNDThe requested resource does not exist
INTERNAL_ERRORAn 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​

  1. Create an API Key
  2. Install an SDK
  3. Make your first request

Next Steps​

// Authentication // Endpoints // Rate Limits