API Documentation
Access your mining data programmatically with our REST API
Account-based mining requires authentication with a watcher token. Use this mode to access your account's mining statistics, balances, and transaction history.
All API endpoints require authentication using a token parameter. You can obtain your API token from:
Mining Dashboard → Account Settings → Watchers → Token
Include the token as a query parameter in all requests:
Available Endpoints
cURL Example:
curl -X GET "https://ourpool.io/api/v1/accounts/{account}/btc/rewards-stats?token=YOUR_TOKEN"JavaScript Example:
const response = await fetch('https://ourpool.io/api/v1/accounts/{account}/btc/rewards-stats?token=YOUR_TOKEN');
const data = await response.json();
console.log(data);Python Example:
import requests
response = requests.get('https://ourpool.io/api/v1/accounts/{account}/btc/rewards-stats',
params={'token': 'YOUR_TOKEN'})
data = response.json()
print(data)Rate Limits
- • 100 requests per minute per token
- • 1000 requests per hour per token
- • Rate limits reset every hour
Best Practices
- • Cache responses when possible
- • Use appropriate polling intervals
- • Handle errors gracefully
- • Keep your token secure
If you have questions about the API or need assistance with integration, please contact our support team.
Error Responses
This error occurs when the request is made without the required token parameter.
Response:
{
"code": "auth.unauthorized",
"message": "Unauthorized",
"redirect": "/api/oauth/authorize?state=516acf17-a209-4c65-b423-61c30d2294a0"
}Error code identifying the type of authentication error.
Human-readable error message.
OAuth authorization URL for obtaining a valid token.
This error occurs when the provided token is invalid or doesn't have sufficient permissions.
Response:
{
"code": "auth.unexpected_error",
"message": "permission check failed"
}Error code indicating an authentication/permission error.
Description of the permission failure.