Giter Club home page Giter Club logo

minergate-api's Introduction

MinerGate API

Host: https://api.minergate.com

Currencies List

Currency Name Currency Code (cc)
Bitcoin btc
Litecoin ltc
Bytecoin bcn
Monero xmr
FantomCoin fcn
QuazarCoin qcn
DigitalNote xdn
MonetaVerde mcn
Dashcoin dsh
Aeon coin aeon
Infinium-8 inf8

Non-authorized API methods

Methods list

Profit rating

Summary: Returns the list of all currencies sorted by profitability.

Method: GET

Path: /1.0/pool/profit-rating

Example response:

["btc", "qcn", "xmr", "bcn"]

Top hashrate

Summary: Returns the lists of top 10 miners for each currency.

Method: GET

Path: /1.0/pool/top/hashrate

Example response:

{
"xmr": [
    {
      "hashrate": 536450.558066599,
      "nickname": "nickname1"
    },
    {
      "hashrate": 90208.49551531563,
      "nickname": "nickname2"
    },
    {
      "hashrate": 55373.55420204257,
      "nickname": "nickname3"
    }, ...
  ], 
"bcn" : {
  ...
}, ...}

Blockchain info

Summary: Returns the blockchain data of the specified currency. Returned values are as follows: chain height, last block timestamp, network difficulty, network hashrate, base reward.

Method: GET

Path: /1.0/:cc/status

Example request: /1.0/xmr/status

Example response:

{
  "hash": "04ab3e8bb9c7724b27563cb9c5cab9d25f948f4579e57deb9b7a95b4b66e4acc",
  "height": 940410,
  "orphan": false,
  "timestamp": 1454512169,
  "difficulty": 795820297,
  "prevBlockHash": "21af39326483b2f1d4556e0e363887e28aeb7e1753eec2e1e2ba4d984ecccae3",
  "sizeMedian": 210,
  "blockSize": 254,
  "txCumulativeSize": 210,
  "txCount": 1,
  "baseReward": 7.193899826126,
  "penalty": 0,
  "reward": 7.193899826126,
  "feeSumm": 0,
  "alreadyGeneratedCoins": 10903400.563529158,
  "cumulativeTxCount": 1481736,
  "rewardBlocksWindow": 100,
  "fullRewardMaxBlockSize": 20000,
  "instantHashrate": 13263671.616666667
}

Login

Summary: Authorizes the user and gives token for the following methods.

Method: POST

Path: /1.0/auth/login

Content-Type: application/json

Body: email, password, totp (2-step authorization token, required if 2-step authorization is enabled)

Example body:

{
  "email": "[email protected]",
  "password": "your_password",
  "totp": 123456
}

Possible errors:

{
  "error": "WrongEmailOrPassword",
  "message": "Email and password did not match."
}
{
  "error": "TotpRequired",
  "message": "Two-factor authorization is enabled for this account. Please provide TOTP code."
}

Example success response:

{
  "token": "1c2VySWQiOiJibGFja19sdWdhMkBtYW1c2VySWQiOiJibGFja19sdWdhMkBtYW1c2VySWQiOiJibGFja19sdWdhMkBtYW"
}

Authorized API methods

To perform the authorized request, put the token to its header. The token value is generated during login process.

Node.js authorized request example:

var request = require('request');
var token = 'your_token_here'

function callback(error, response, body) {
    if (!error && response.statusCode == 200) {
        return body;
    } else {
        console.log(response.statusMessage);
    }
}

request.get({
    url: 'https://api.minergate.com/1.0/transfers',
    headers: {
        'content-type': 'application/json',
        'token': token
    },
    json: true
}, callback);

PHP authrozied request example:

<?php
$token = 'your_token_here';

if( $curl = curl_init() ) {
    curl_setopt($curl, CURLOPT_URL, 'https://api.minergate.com/1.0/transfers');
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HTTPHEADER, array(
        'Content-Type: application/json',
        'token: ' . $token
    ));
    $out = curl_exec($curl);
    echo $out;
    curl_close($curl);
}

Methods list

Balance

Summary: Returns the user’s balance. Requires authorization.

Method: GET

Path: /1.0/balance

Example response:

{
  "aeon": "30.66592521533400000000",
  "bcn": "30143.50038210000000000000",
  "btc": "0.00800000000000000000",
  "dsh": "2.80476725202",
  "xdn": "4.53423417000000000000",
  "fcn": "4.14526383581300000000",
  "inf8": "24.88587286959600000000",
  "ltc": "0.10015669000000000000",
  "mcn": "16.42067126414000000000",
  "xmr": "0.01750385351100000000",
  "qcn": "13.59907377987700000000"
}

Transfers

Summary: Returns the list of user’s transfers. Requires authorization.

Method: GET

Path: /1.0/transfers/:cc

Example request: /1.0/transfers/xdn

Example response:

[
  {
    "cc": "xdn",
    "amount": 700,
    "fromUserId": "[email protected]",
    "toUserId": "[email protected]",
    "id": "c5d7b9d3-c2ce-4621-825c-58cbb5ea6eff",
    "state": "finished",
    "created": 1449161749429
  },
  {
    "cc": "xdn",
    "amount": 10,
    "fromUserId": "[email protected]",
    "toUserId": "[email protected]",
    "id": "e81cde3a-9b67-4f5e-98ad-08ce7884e02a",
    "state": "finished",
    "created": 1448977022415
  }
]

Example request: /1.0/transfers/

Example response:

[
  {
    "cc": "bcn",
    "amount": 700,
    "fromUserId": "[email protected]",
    "toUserId": "[email protected]",
    "id": "c5d7b9d3-c2ce-4621-825c-58cbb5ea6eff",
    "state": "finished",
    "created": 1449161749429
  },
  {
    "cc": "inf8",
    "amount": 10,
    "fromUserId": "[email protected]",
    "toUserId": "[email protected]",
    "id": "e81cde3a-9b67-4f5e-98ad-08ce7884e02a",
    "state": "finished",
    "created": 1448977022415
  }
]

Withdrawals

Summary: Returns the list of user’s withdrawals for all the currencies or a specific currency if such parameter is set. Requires authorization.

Method: GET

Path: /1.0/withdrawals/:cc

Example request: /1.0/withdrawals/xdn

Example response:

[
  {
    "cc": "xdn",
    "address": "address",
    "transactionHash": "acaef20101873165b576ec44f0754c4847e5c16831b79810cff71a2eb7c00a38",
    "amount": 1.9,
    "fee": 0.1,
    "paymentId": "paymentId",
    "transactionId": "5bb3f705-82e2-4b61-8651-7567571c72f3",
    "status": "finished",
    "created": 1451151685.785
  },
  {
    "cc": "xdn",
    "address": "address",
    "transactionHash": "acaef20101873165b576ec44f0754c4847e5c16831b79810cff71a2eb7c00a38",
    "amount": 1.9,
    "fee": 0.1,
    "paymentId": "paymentId",
    "transactionId": "5bb3f705-82e2-4b61-8651-7567571c72f3",
    "status": "finished",
    "created": 1451151685.785
  }
]

Example request: /1.0/withdrawals

Example response:

[
  {
    "cc": "fcn",
    "address": "address",
    "transactionHash": "acaef20101873165b576ec44f0754c4847e5c16831b79810cff71a2eb7c00a38",
    "amount": 1.9,
    "fee": 0.1,
    "paymentId": "paymentId",
    "transactionIdHash": "5bb3f705-82e2-4b61-8651-7567571c72f3",
    "status": "pending",
    "created": 1451151685.785
  },
  {
    "cc": "bcn",
    "address": "address",
    "transactionHash": "acaef20101873165b576ec44f0754c4847e5c16831b79810cff71a2eb7c00a38",
    "amount": 1.9,
    "fee": 0.1,
    "paymentId": "paymentId",
    "transactionIdHash": "5bb3f705-82e2-4b61-8651-7567571c72f3",
    "status": "finished",
    "created": 1451151685.785
  }
]

Workers

Summary: Returns the number of user’s active workers. Requires authorization.

Method: GET

Path: /1.0/workers

Example response:

{
  "bcn": {
    "minersCount": 1,
    "hashrate": 322.484387977974,
    "hashrateRank": 256
  },
  "fcn": {
    "minersCount": 1,
    "hashrate": 322.484387977974,
    "hashrateRank": 155
  }
}

Mining stats

Summary: Returns the user’s mining statistics. Requires authorization.

Method: GET

Path: /1.0/mining/stats

Example response:

{
  "bcn": {
    "unconfirmedBalance": 191049661,
    "minersCount": "1",
    "hashrate": "65.405322258114126",
    "hashrateRank": 1061,
    "minerOnline": true,
    "shares": {
      "good": 827813,
      "goodEq": 968780359,
      "bad": 3469,
      "badEq": 4033431,
      "invalid": 0,
      "invalidEq": 0
    },
    "ppsTotalMined": 111023.92139614478,
    "pplnsTotalMined": 22249.54433594,
    "blocksFound": 5,
    "totalMined": 133273.4657320848
  }, ...
  "paymentModels": {
    "bcn": "pps",
    "fcn": "pps",
    "dsh": "pplns",
    "xmr": "pps",
    "qcn": "pps",
    "xdn": "pps",
    "mcn": "pps",
    "aeon": "pps",
    "inf8": "pps",
    "btc": "pps",
    "ltc": "pps"
  },
  "timestamp": 1454496693669
}

Affiliate links

Summary: Returns the list of user’s affiliate links. Requires authorization.

Method: GET

Path: /1.0/affiliate/links

Example response:

{
  "/a/7d14d06a612312349": "link",
  "/a/ad9e3352adde3f7123256556": "link2",
  "/a/f36f11e816381123b9b12295": "link3",
  "/a/37d05a536010d46a123e44f4": "link4",
  "/a/15e64ffe0aa0aa506dcg452a": "link5"
}

Affiliates

Summary: Returns the list of user’s affiliates. Requires authorization.

Method: GET

Path: /1.0/affiliate/childrens

Example response:

{
  "[email protected]": {
    "registered": 1426754165398,
    "profits": {
      "bcn": 34.91620052067053,
      "xmr": 0.0014406817930471406,
      "xdn": 0.05284179398738854,
      "mcn": 0.00000356443120348296,
      "qcn": 9.373443247396294,
      "fcn": 0.04380865486606831,
      "aeon": 9.385291553402276,
      "dsh": 1244.935845946683
    },
    "lastProfit": 1454496377768,
    "token": "/a/d976f19wefr234fasdfd598"
  },
  "[email protected]": {
    "registered": 1426229844791,
    "token": "/a/d976f11231d598"
  },
}

Affiliate profit

Summary: Returns the user’s income from affiliates. Requires authorization.

Method: GET

Path: /1.0/affiliate/profit

Example response:

{
  "bcn": 48481.30996792437,
  "xmr": 0.22784646878529005,
  "xdn": 0.8658647284964952,
  "mcn": 23.31826311843995,
  "qcn": 11.443061561369651,
  "fcn": 0.32156100510772107,
  "aeon": 24.456462240551215,
  "dsh": 6193.343139060691,
  "ltc": 0.0001675684355892698,
  "inf8": 3.279558343484024,
  "btc": 0.00000503616312175371
}

Invoices

Summary: Returns the list of user's invoices. Requires authorization.

Method: GET

Path: /1.0/invoices

Example response:

[
  {
    "amount": 100000,
    "cc": "bcn",
    "address": "address",
    "comment": "Some text from invoice creator",
    "expiredDate": 1454273838471,
    "invoiceId": "44872a9e0dbb66fa5b5782cfef36f5b4bcdfba43",
    "created": 1454101038531,
    "status": "finished",
    "email": "[email protected]",
    "finished": 1454101196469
  }, ...
]

Invoice

Summary: Returns the specified invoice. Requires authorization.

Method: GET

Path: /1.0/invoices/:id

Example request: /1.0/invoices/44872a9e0dbb66fa5b5782cfef36f5b4bcdfba43

Example response:

{
  "amount": 100000,
  "cc": "bcn",
  "address": "address",
  "comment": "Some text from invoice creator",
  "expiredDate": 1454273838471,
  "invoiceId": "44872a9e0dbb66fa5b5782cfef36f5b4bcdfba43",
  "created": 1454101038531,
  "status": "finished",
  "email": "[email protected]",
  "finished": 1454101196469
}

Nickname

Summary: Returns the user’s nickname. Requires authorization.

Method: GET

Path: /1.0/profile/nickname

Example response:

"YourNickname"

minergate-api's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

minergate-api's Issues

Is the API service stop running

Information:

time: 2019-5-18 19:52:53
use Insomnia to test API

When I try to use any API, there is a message that always show up.

{
  "error": "ApiDiscontinued",
  "message": ""
}

Is the API service stop running?

Thanks.

Python Wrapper + problems with login tokens

Hi, i made a python wrapper for this api: https://github.com/amahlaka/Minergate-python
I noticed that both profit rating and login functions of the api are broken
profit rating returns only [] and login returns : {"code":"InternalError","message":"Cannot read property 'send' of undefined"}
My workaround for this issue: i found my login token from cookies on my computer after using rest client to login, and getting the internal error response

login doesn't work

returns {"code":"InternalError","message":"Cannot read property 'send' of undefined"}

login error

Im not sure what went wrong and I can confirm my credential is valid but when I try this API URL "https://api.minergate.com/1.0/auth/login" I'm getting error as below which wasn't in your description.

{"error":"MissingEmail","argument":"email","message":"User email must be specified."}

FYI, I didnt enable 2-step authorization so I guess passing empty value to parameter 'totp' is ok?

InternalError /1.0/auth/login

POST /1.0/auth/login HTTP/1.1
Host: api.minergate.com
Content-Type: application/json
Cache-Control: no-cache
Postman-Token: 0e9fc3e0-c966-f2fb-8d6d-746834825d8e

included totp
email was chrislangton84 "at" gmail "d" com

response;

{
    "code": "InternalError",
    "message": "Cannot read property 'send' of undefined"
}

should work with any other credentials if it is a code error as it appears to be;

curl -X POST \
  https://api.minergate.com/1.0/auth/login \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{
  "email": "[email protected]",
  "password": "yours here",
  "totp": 123456
}'

API does not work :(

{"code":"InternalError","message":"Cannot read property 'send' of undefined"}

Internal Server Error - Login

Hello,

The following response is received when trying to hit your login endpoint at /1.0/auth/login

{ "code": "InternalError", "message": "Cannot read property 'send' of undefined" }

I am using Insomnia to fire off the request and using the following parameters as stated in your documentation.

Method: POST
Headers: Content-Type: application/json
Body: { "email": "[email protected]", "password": "xxxxxxxxx"}

I have tried the request with the optional parameter of totp and obviously as shown above, without the parameter. Either the API documentation is out-dated or the server is having issues.

Please confirm when this issue has been resolved or at least checked out.

api login problem help me

my code

`<?php
$data = array(
"email" => "[email protected]",
"password" => "xxxxxx"
);
$data_json = json_encode($data);
$url = "https://api.minergate.com/1.0/auth/login";

$curl = curl_init($url);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_POSTFIELDS, $data_json);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json')
);
$result = curl_exec($curl);
curl_close($curl);
echo $result ;

?>
`
output data has been
{"code":"InternalError","message":"Cannot read property 'send' of undefined"}

help me plz...

Error while testing

Always recieving one of these errors while running the code:

ERR_CONNECTION_TIMED_OUT
or
ERR_NETWORK_CHANGED

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.