API Overview
NOCY Protocol provides two main APIs for interacting with the ecosystem.
Available APIs
| API | Base URL | Description |
|---|---|---|
| Get NOCY API | https://api.get.nocy.io | Token purchase and order management |
| Explorer API | https://api.explorer.nocy.io | Blockchain data and real-time streams |
Common Patterns
Request Format
All APIs accept and return JSON. Set the appropriate headers:
Content-Type: application/json
Accept: application/json
Response Format
Successful responses return the requested data directly:
{
"priceInAda": 0.001
}
Error Responses
Errors follow a consistent format:
{
"error": "Error message description",
"statusCode": 400
}
HTTP Status Codes
| Code | Description |
|---|---|
200 | Success |
201 | Created (for POST requests) |
400 | Bad Request - Invalid parameters |
404 | Not Found - Resource doesn't exist |
500 | Internal Server Error |
Authentication
Currently, NOCY APIs are public and do not require authentication. Rate limiting is applied to prevent abuse.
API keys and authentication may be introduced for premium features in future versions.
Rate Limiting
To ensure fair usage, APIs implement rate limiting:
| API | Rate Limit |
|---|---|
| Get NOCY API | 100 requests/minute |
| Explorer API | 200 requests/minute |
When rate limited, you'll receive a 429 Too Many Requests response.
Pagination
List endpoints support pagination with these parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | number | 20 | Number of items per page (max: 100) |
offset | number | 0 | Number of items to skip |
sortBy | string | varies | Field to sort by |
sortDir | string | desc | Sort direction (asc or desc) |
Example:
curl "https://api.explorer.nocy.io/api/blocks?limit=10&offset=20&sortDir=asc"
CORS
APIs support Cross-Origin Resource Sharing (CORS) for browser-based applications. All origins are currently allowed.
Versioning
APIs are currently at version 1.0. Breaking changes will be communicated in advance and may introduce versioned endpoints (e.g., /v2/api/...).
SDKs
Official SDKs are planned for:
- JavaScript/TypeScript
- Python
- Rust
Until then, use standard HTTP clients in your preferred language.
Next Steps
- Get NOCY API - Token purchase API
- Explorer API - Blockchain explorer API