API Documentation

Antscoin API

Build on Antscoin with our comprehensive REST API and SDKs

Quick Start

1. Get API Key

Sign up and generate your API key from the dashboard

2. Install SDK

Choose from JavaScript, Python, or Go SDKs

3. Start Building

Make your first API call in minutes

Base URL

https://api.ants-coin.org

Authentication

Bearer Token

Rate Limit

1000 req/hour

Version

v1.0

SDK Examples

// Install SDK
npm install @antscoin/sdk

// Initialize
import { AntsSDK } from '@antscoin/sdk';

const sdk = new AntsSDK({
  apiKey: 'your-api-key',
  network: 'mainnet'
});

// Start mining
const session = await sdk.mining.start({
  plotSize: 101,
  threads: 4
});

console.log('Mining started:', session.sessionId);

Mining Endpoints

GET
/api/v1/mining/stats

Get current mining statistics

Response:

{
  "difficulty": 256,
  "hashrate": "1.23 EH/s",
  "blockHeight": 123456,
  "nextHalving": 654321,
  "totalMiners": 50234
}
POST
/api/v1/mining/start
Auth Required

Start a new mining session

Request Body:

{
  "plotSize": 101,
  "threads": 4,
  "walletAddress": "0x..."
}

Response:

{
  "sessionId": "abc123",
  "status": "mining",
  "estimatedReward": "100 ANTS"
}
DELETE
/api/v1/mining/stop/{sessionId}
Auth Required

Stop an active mining session

Response:

{
  "status": "stopped",
  "rewards": "50 ANTS"
}

Wallet Endpoints

GET
/api/v1/wallet/balance/{address}

Get wallet balance

Response:

{
  "address": "0x...",
  "balance": "1000 ANTS",
  "pendingRewards": "50 ANTS",
  "stakedAmount": "500 ANTS"
}
GET
/api/v1/wallet/transactions/{address}?limit=10&offset=0

Get wallet transaction history

Response:

{
  "transactions": [
    {
      "hash": "0x...",
      "type": "mining_reward",
      "amount": "100 ANTS",
      "timestamp": "2024-12-20T10:00:00Z"
    }
  ],
  "total": 156
}

Governance Endpoints

GET
/api/v1/governance/proposals

Get active governance proposals

Response:

{
  "proposals": [
    {
      "id": 1,
      "title": "Reduce mining difficulty",
      "status": "active",
      "votesFor": 1234,
      "votesAgainst": 567
    }
  ]
}
POST
/api/v1/governance/vote
Auth Required

Vote on a proposal

Request Body:

{
  "proposalId": 1,
  "vote": "for",
  "amount": "100 ANTS"
}

Response:

{
  "success": true,
  "voteWeight": "100 ANTS"
}

API Playground

Test API endpoints directly in your browser

Code Examples

Browse complete example applications

API Status

Check current API status and uptime