WhatToMine API Documentation

API Authorization

To access the API endpoints, you need to include your API token for authorization. There are two ways to include your token:

1. Authorization Header

Include the following header in your HTTP request:

Authorization: Token <your_api_token>

2. Query Parameter

Alternatively, you can include your API token as a query parameter in the URL:

?api_token=<your_api_token>

Replace <your_api_token> with your actual API token.

Calculation Endpoint

GET /api/v1/calculate

Calculate mining profitability based on provided parameters.

This endpoint provides a shorthand syntax for passing in per-algorithm settings, so that they fit within the request URL limits. See the POST version for a more machine-friendly format.

Request Parameters

  • cost: Electricity cost (optional)
  • Algorithm parameters: Format {algorithm_name}={power}|{hashrate}{unit}

Example:

/api/v1/calculate?cost=0.1&lrev2=1500|145M&eth=2000|100G

Response

Returns a list of coins with their profitability metrics based on the input parameters.

POST /api/v1/calculate

Calculate mining profitability based on provided parameters.

Request Parameters

  • cost: Electricity cost (float)
  • settings: Array of algorithm settings

Example request body:


  {
    "cost": 0.1,
    "settings": [
      {
        "algorithm": "sha256",
        "power": 3500,
        "hashrate": 110000000000000
      },
    ]
  }
  

Response

Returns a list of coins with their profitability metrics based on the input parameters.


[
  {
    "id": 1,
    "tag": "BTC",
    "name": "Bitcoin",
    "estimated_rewards": "0.03116",
    "estimated_rewards24": "0.02996",
    "btc_revenue": "0.03115865",
    "btc_revenue24": "0.02996024",
    "revenue": "121.18",
    "revenue24": "116.52",
    "profit": "112.78",
    "profit24": "108.12"
  }
]
  

Algorithms Endpoint

GET /api/v1/algorithms

Retrieve a list of supported mining algorithms.

Request Parameters

None required.

Response

Returns a list of available mining algorithms.


[
  {
    "name": "Aion",
    "param_name": "eqa"
  },
  {
    "name": "Argon2d-NIM",
    "param_name": "a2n"
  },
  {
    "name": "Autolykos",
    "param_name": "al"
  },
  # ...
]
      

Coins Endpoint

GET /api/v1/coins

Retrieve a list of active coins with their current statistics and exchange rates.

Request Parameters

None required.

Response

Returns a list of active coins, including their latest statistics and current exchange rates.


[
  {
    "id": 57,
    "tag": "ALPH",
    "name": "Alephium",
    "algorithm": "Blake3",
    "algo_param_name": "b3",
    "lagging": false,
    "testing": false,
    "last_update": "2018-12-17T10:37:01.000Z",
    "nethash": 877038100746891,
    "last_block": 1451338,
    "difficulty": 3.508152402987565e+15,
    "difficulty24": 3.808152402987565e+15,
    "difficulty3": 3.608152402987565e+15,
    "difficulty7": 3.308152402987565e+15,
    "difficulty14": 3.408152402987565e+15,
    "difficulty30": 3.708152402987565e+15,
    "exchanges": [
      {
        "name": "Poloniex",
        "last_update": "2018-12-17T10:37:01.000Z",
        "price": 2.5e-05,
        "price24": 2.5e-05,
        "price3": 2.5e-05,
        "price7": 2.5e-05,
        "price14": 2.5e-05,
        "price30": 2.5e-05,
        "volume": 1.0
      }
    ]
  },
  # ...
]
      

These endpoints provide essential information for cryptocurrency mining calculations and decision-making. The API is designed to be user-friendly and provide up-to-date information on algorithms, coins, and profitability calculations.