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.

Authentication

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:

?token=YOUR_TOKEN_HERE
Base URL
https://ourpool.io

Available Endpoints

Usage Examples

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 & Best Practices

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
Need Help?

If you have questions about the API or need assistance with integration, please contact our support team.

Error Responses

401
Unauthorized - Missing Token

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"
}
code

Error code identifying the type of authentication error.

message

Human-readable error message.

redirect

OAuth authorization URL for obtaining a valid token.

403
Forbidden - Invalid 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"
}
code

Error code indicating an authentication/permission error.

message

Description of the permission failure.