API Documentation
This API is still in BETA. These methods are subject to change without notice, and some methods may be added/removed as we improve this system.
This is API V2 documentation.
API V2 Last Updated April 17, 2021
General
The version 2 API is a fully RESTful API. It allows much more control over your account, rigs, and rentals than version 1 does. This is a complete re-write of the API, none of the version 1 API calls will work with version 2.
Note that the authentication schema has changed slightly as well.
Demos of expected responses for each endpoint are provided under methods. If there is a failure, there will be a message under the data key in the response detailing the failure. If multiple items are specified, the call may fail completley with a message, or an array of items with a message depending on the call. You should also always watch for http response errors.
Authentication
All methods for this API requires authentication. Authentication uses an HMAC signing process as follows
- You must include a nonce variable with all authenticated calls, and each nonce must be unique and greater than the previous call's nonce, passed in the header variable 'x-api-nonce'
- Your API Key must be passed in the header using the variable 'x-api-key'
- The HMAC signed endpoint must be passed in the header using the variable 'x-api-sign'
The x-api-sign field is a SHA1 HMAC hash of the concatenated string consisting of your API Key, the nonce, and the endpoint without a trailing slash -- signed with your API Secret
For example, if you're calling a GET on /rig/14 with a nonce of 12345, your API Key is 'APIKEY', and your API Secret is 'APISECRET', then you would sign "APIKEY12345/rig/14" with APISECRET -- see the Example tab for a detailed example.
$api_key = 'identifier'; // your API-key $api_secret = 'secret'; // your Secret-key $mtime = explode(' ',microtime()); $nonce = $mtime[1].substr($mtime[0], 2, 4); $api_base = "https://www.miningrigrentals.com/api/v2/"; $endpoint = "/rig/14"; //String to sign is api_key + nonce + endpoint $sign_string = $api_key.$nonce.$endpoint; //Sign the string using a sha1 hmac $sign = hash_hmac("sha1", $sign_string, $api_secret); // generate the extra headers $headers = array( 'x-api-sign: '.$sign, 'x-api-key: '.$api_key, 'x-api-nonce: '.$nonce ); // our curl handle (initialize if required) static $ch = null; if (is_null($ch)) { $ch = curl_anit(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MRR API PHP client; '.php_uname('s').'; PHP/'.phpversion().')'); } curl_setopt($ch, CURLOPT_URL, $api_base.$endpoint); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); // run the query $content = curl_exec($ch);
Change Log
** 2022-05-04
- Updated GET /rental/../graph and /rig/../graph endpoints with two new optional parameters, updated and fixed the description and examples.
** 2022-03-19
- Updated GET /rental/ID endpoint to include new information. Added example and output to GET /rental/ID description. Updated GET /info/currencies output description. Updated GET /riggroup and /riggroup/ID output description. Added GET /rental/ID/log endpoint to obtain obtain 'Activity Log' detail messages on one or more of your rentals, and description. Added GET /pricing endpoint and description.
** 2021-04-17
- BTC is now an option available to turn pricing on or off with for your rig, like with other altcoins.
** 2021-03-09
- Updated /account/transactions Endpoint. Some non relevant data items are no longer listed when not needed. There are new data items. New filter by time, updated description and fixed the limit output.
** 2021-01-18
- Enabled /account/pool/test Used to test if a pool is compatible with MRR.
** 2021-01-14
- Add /rig/batch/extend Used to extend a rental on a list of your rigs with individually specified length.
** 2021-01-07
- Add txfee to /info/currencies. txfee is the current fee being charged for withdraw, it *may* change every 15 minutes.
** 2021-01-05
- Add /info/currencies and /account/currencies endpoints and info.
** 2020-12-10
- Update information and examples for Account endpoint.
** 2020-12-04
- Added note to /info/servers about port information depreciation.
** 2020-11-28
- Example for GET /rig/.../graph use get not put.
- Add GET /rental/.../graph endpoint like GET /rig/.../graph
- Add GET /rental/.../message endpoint for obtaining rental message list.
- Add PUT /rental/.../message endpoint for adding a message to a rental.
** 2020-11-21
- Fixed 'orderby' options in GET /rig
** 2020-06-02
- Added 'description' to the PUT /rig and POST /rig/batch endpoints
This endpoint is active
GET /whoami
Test connectivity and return information about you
$mrr->get("/whoami");
{ "success": true, "data": { "authed": true, "userid": "123456789", "api_key": "xxxxxxxxxxxxxxxxxx", "api_sign": "yyyyyyyyyyyyyyyyyyy", "api_nonce": "12345", "auth_mesage": "", "permissions": { "withdraw": "yes", "rent": "yes", "rigs": "yes" } } }
GET /info/servers
Get a list of MRR rig servers. Please note the port and ethereum_port entries are depreciated, port information is dependant on your rig. Please see /rig/port for that information.
$mrr->get("/info/servers");
{ "success": true, "data": [ { "id": "6", "name": "us-central01.miningrigrentals.com", "region": "us-central", "port": "3333", "ethereum_port": "3344" }, { "id": "4", "name": "us-west01.miningrigrentals.com", "region": "us-west", "port": "3333", "ethereum_port": "3344" }, { "id": "9", "name": "eu-ru01.miningrigrentals.com", "region": "eu-ru", "port": "3333", "ethereum_port": "3344" }, { "id": "3", "name": "us-east01.miningrigrentals.com", "region": "us-east", "port": "3333", "ethereum_port": "3344" }, { "id": "10", "name": "eu-de02.miningrigrentals.com", "region": "eu-de", "port": "3333", "ethereum_port": "3344" }, { "id": "7", "name": "eu-de01.miningrigrentals.com", "region": "eu-de", "port": "3333", "ethereum_port": "3344" }, { "id": "5", "name": "eu-01.miningrigrentals.com", "region": "eu", "port": "3333", "ethereum_port": "3344" }, { "id": "2", "name": "ap-01.miningrigrentals.com", "region": "ap", "port": "3333", "ethereum_port": "3344" } ] }
GET /info/algos
Get all algos and statistics for them (suggested price, unit information, current rented hash/etc)
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
currency | N | STRING | BTC | Currency to use for price info |
$mrr->get("/info/algos");
{ "success": true, "data": [ { "name": "scrypt", "display": "Scrypt", "suggested_price": { "amount": "0.00000284", "currency": "BTC", "unit": "mh*day" }, "stats": { "available": { "rigs": "661", "hash": { "hash": 882695.19551, "unit": "mh", "nice": "882.70G" } }, "rented": { "rigs": "674", "hash": { "hash": 505802.792674, "unit": "mh", "nice": "505.80G" } }, "prices": { "lowest": { "amount": "0.00000280", "currency": "BTC", "unit": "mh*day" }, "last_10": { "amount": "0.00000408", "currency": "BTC", "unit": "mh*day" }, "last": { "amount": "0.00000283", "currency": "BTC", "unit": "mh*day" } } } }, ... { "name": "sha256", "display": "Sha256", "suggested_price": { "amount": "0.00024304", "currency": "BTC", "unit": "th*day" }, "stats": { "available": { "rigs": "310", "hash": { "hash": 5595.12426401, "unit": "th", "nice": "5.60P" } }, "rented": { "rigs": "462", "hash": { "hash": 13246.597, "unit": "th", "nice": "13.25P" } }, "prices": { "lowest": { "amount": "0.00022500", "currency": "BTC", "unit": "th*day" }, "last_10": { "amount": "0.00033500", "currency": "BTC", "unit": "th*day" }, "last": { "amount": "0.00021997", "currency": "BTC", "unit": "th*day" } } } } ] }
GET /info/algos/[NAME]
Get statistics for an algo (suggested price, unit information, current rented hash/etc)
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
currency | N | STRING | BTC | Currency to use for price info |
$mrr->get("/info/algos/scrypt");
{ "success": true, "data": { "name": "scrypt", "display": "Scrypt", "suggested_price": { "amount": "0.00000284", "currency": "BTC", "unit": "mh*day" }, "stats": { "available": { "rigs": "663", "hash": { "hash": 883325.19551, "unit": "mh", "nice": "883.33G" } }, "rented": { "rigs": "672", "hash": { "hash": 505172.792674, "unit": "mh", "nice": "505.17G" } }, "prices": { "lowest": { "amount": "0.00000280", "currency": "BTC", "unit": "mh*day" }, "last_10": { "amount": "0.00000408", "currency": "BTC", "unit": "mh*day" }, "last": { "amount": "0.00000283", "currency": "BTC", "unit": "mh*day" } } } } }
GET /info/currencies
Get a list of currencies currently used for payments that are installed into our system. The currency may be enabled or disabled, disabled means that no function with that currency should work or attempted to be performed. Pair with /account/currencies endpoint. Each account has a seperate currency enablement status. We may add or disable a currency at any time. txfee is the current fee being charged for withdraw, it *may* change every 15 minutes.
$mrr->get("/info/currencies");
{ "success": true, "data": { "currencies": [ { "name": "BTC", "enabled": true, "txfee": "0.00001" }, { "name": "LTC", "enabled": true, "txfee": "0.000025" }, { "name": "ETH", "enabled": true, "txfee": "0.001503" }, { "name": "BCH", "enabled": true, "txfee": "0.000013" }, { "name": "DOGE", "enabled": true, "txfee": "0.000025" } ] } }
This endpoint is active
GET /account
Retrieve account information
$mrr->get("/account");
{ "success": true, "data": { "username": "awesomeuser", "email": "[email protected]", "withdraw": { "BTC": { "address": "1xxxxx", "label": "", "auto_pay_threshold": "0.00000000", "txfee": 0.0005 }, "LTC": { "address": "Lxxxxx", "label": "", "auto_pay_threshold": "0.00000000", "txfee": 0.001 }, "ETH": { "address": "", "label": "", "auto_pay_threshold": "0.00000000", "txfee": 0.001 }, "DOGE": { "address": "Dxxxxx", "label": "", "auto_pay_threshold": "0.00000000", "txfee": 0.001 } }, "deposit": { "BTC": { "address": "3xxxxxxx" }, "LTC": { "address": "Lxxxxxxx" }, "ETH": { "address": "0xxxxxxx" }, "DOGE": { "address": "Dxxxxxxx" } }, "notifications": { "rental_comm": "no", "new_rental": "no", "offline": "no", "news": "no", "deposit": "yes" }, "settings": { "live_data": "no", "public_profile": "yes", "2factor_auth": "yes" } } }
GET /account/balance
Retrieve account balances
$mrr->get("/account/balance");
{ "success": true, "data": { "BTC": { "confirmed": "0.09449622", "pending": 0, "unconfirmed": "0.00000000" }, "LTC": { "confirmed": "0.00000000", "pending": 0, "unconfirmed": "0.00000000" }, "ETH": { "confirmed": "2.09518889", "pending": 0, "unconfirmed": "0.00000000" }, "DOGE": { "confirmed": "0.00000000", "pending": 0, "unconfirmed": "0.00000000" } } }
PUT /account/balance
Request a payout/withdrawal. This endpoint is disabled untill we can find a way to offer this without risk.
Path | Required | Data Type | Default | Info |
---|
GET /account/transactions
List/search transaction history. `id`:always, `type`:always, `currency`:always, `amount`:always; and is negative when a deduction, `when`:always as UTC.
`rental`,`rig`:only when not (`type` = ('Payout' or 'Deposit')). `txid`:only when `type` = ('Payout' or 'Deposit').
`txfee`,`payout_address`:only when `type` = 'Payout'. `sent`: only when `sent`='no' and `type` = 'Payout'. `status`:always and is 'Cleared' or 'Pending',`pending_seconds`:always and is non 0 when `status` = 'Pending'. `info`: only when not (`type` = ('Payout' or 'Deposit')) and there is an extra comment/info for the transaction.
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
start | N | INT | 0 | Start number (for pagination) |
limit | N | INT | 100 | Limit number (for pagination) |
algo | N | STRING | Algo to filter -- see /info/algos | |
type | N | STRING | Type to filter -- one of ['credit','payout','referral','deposit','payment','credit/refund','debit/refund','rental fee'] | |
rig | N | INT | Filter to specific rig. | |
rental | N | INT | Filter to specific rental. | |
txid | N | STRING | Filter to specific txid. | |
time_greater_eq | N | STRING | Filter to greater then or equal, as Unix Timestamp integer. | |
time_less_eq | N | STRING | Filter to less then or equal, as Unix Timestamp integer. |
$params = array( "start"=>0, "limit"=>10, "rig"=>17 ); $mrr->get("/account/transactions",$params);
{ "success": true, "data": { "total": "89", "returned": 10, "start": 0, "limit": 10, "transactions": [ { "id": "508680", "type": "Credit\/Refund", "amount": "0.00010000", "when": "2014-10-23 02:35:13", "rental": "19", "rig": "17", "txid": "" }, { "id": "508666", "type": "Credit\/Refund", "amount": "0.00010000", "when": "2014-10-23 02:29:10", "rental": "14", "rig": "17", "txid": "" }, { "id": "3058", "type": "Credit", "amount": "0.00078691", "when": "2014-04-28 16:11:26", "rental": "1264", "rig": "17", "txid": "" }, { "id": "3021", "type": "Credit", "amount": "0.00078691", "when": "2014-04-28 13:09:04", "rental": "1256", "rig": "17", "txid": "" }, { "id": "2993", "type": "Credit", "amount": "0.00078691", "when": "2014-04-28 05:29:49", "rental": "1245", "rig": "17", "txid": "" }, { "id": "2980", "type": "Credit", "amount": "0.00078691", "when": "2014-04-28 01:18:31", "rental": "1239", "rig": "17", "txid": "" }, { "id": "2897", "type": "Credit", "amount": "0.00078691", "when": "2014-04-27 19:12:27", "rental": "1207", "rig": "17", "txid": "" }, { "id": "2854", "type": "Credit", "amount": "0.00078691", "when": "2014-04-27 15:02:25", "rental": "1195", "rig": "17", "txid": "" }, { "id": "2850", "type": "Debit\/Refund", "amount": -0.00081125, "when": "2014-04-27 14:29:50", "rental": "1146", "rig": "17", "txid": "" }, { "id": "2718", "type": "Credit", "amount": "0.00078691", "when": "2014-04-27 05:26:21", "rental": "1146", "rig": "17", "txid": "" } ] } }
GET /account/profile
List all pool profiles, or list by algo
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
algo | N | STRING | Algo to filter -- see /info/algos |
$mrr->get("/account/profile");
{ "success": true, "data": [ { "id": "40073", "name": "Scrypt", "algo": { "name": "scrypt", "display": "Scrypt", "suggested_price": { "amount": "0.00000289", "currency": "BTC", "unit": "mh*day" }, "stats": { "available": { "rigs": "558", "hash": { "hash": 1068304.40551, "unit": "mh", "nice": "1.07T" } }, "rented": { "rigs": "786", "hash": { "hash": 660378.067674, "unit": "mh", "nice": "660.38G" } }, "prices": { "lowest": { "amount": "0.00000290", "currency": "BTC", "unit": "mh*day" }, "last_10": { "amount": "0.00000319", "currency": "BTC", "unit": "mh*day" }, "last": { "amount": "0.00000350", "currency": "BTC", "unit": "mh*day" } } } }, "pools": [ { "priority": 0, "type": "scrypt", "host": "pool.ipominer.com", "port": "3333", "user": "merc.1", "pass": "x", "status": "" } ] }, { "id": "41815", "name": "Test Profile", "algo": { "name": "scrypt", "display": "Scrypt", "suggested_price": { "amount": "0.00000289", "currency": "BTC", "unit": "mh*day" }, "stats": { "available": { "rigs": "558", "hash": { "hash": 1068304.40551, "unit": "mh", "nice": "1.07T" } }, "rented": { "rigs": "786", "hash": { "hash": 660378.067674, "unit": "mh", "nice": "660.38G" } }, "prices": { "lowest": { "amount": "0.00000290", "currency": "BTC", "unit": "mh*day" }, "last_10": { "amount": "0.00000319", "currency": "BTC", "unit": "mh*day" }, "last": { "amount": "0.00000350", "currency": "BTC", "unit": "mh*day" } } } }, "pools": null } ] }
PUT /account/profile
Create a pool profile
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
name | Y | STRING | Name of the profile | |
algo | Y | STRING | Algo of the profile -- see /info/algos |
$parms = array( "name"=>"Test Profile", "algo"=>"scrypt", ); $mrr->put("/account/profile",$parms);
{ "success": true, "data": { "pid": "41818" } }
GET /account/profile/[ID]
Get a specific pool profile
$mrr->get("/account/profile/40073");
{ "success": true, "data": { { "id": "40073", "name": "Scrypt", "algo": { "name": "scrypt", "display": "Scrypt", "suggested_price": { "amount": "0.00000289", "currency": "BTC", "unit": "mh*day" }, "stats": { "available": { "rigs": "558", "hash": { "hash": 1068304.40551, "unit": "mh", "nice": "1.07T" } }, "rented": { "rigs": "786", "hash": { "hash": 660378.067674, "unit": "mh", "nice": "660.38G" } }, "prices": { "lowest": { "amount": "0.00000290", "currency": "BTC", "unit": "mh*day" }, "last_10": { "amount": "0.00000319", "currency": "BTC", "unit": "mh*day" }, "last": { "amount": "0.00000350", "currency": "BTC", "unit": "mh*day" } } } }, "pools": [ { "priority": 0, "type": "scrypt", "host": "pool.ipominer.com", "port": "3333", "user": "merc.1", "pass": "x", "status": "" } ] } } }
PUT /account/profile/[ID]
Add or replace a pool to the profile
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
poolid | Y | INT | Pool ID to add -- see /account/pools | |
priority | Y | INT | 0-4 |
$parms = array( "priority"=>,0 "poolid"=>98708 ); $mrr->put("/account/profile/41818",$parms);
{ "success": true, "data": { "id": "41818", "success": true, "message": "Updated" } }
PUT /account/profile/[ID]/[0-4]
Add or replace a pool to a profile
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
poolid | Y | int | Pool ID to add -- see /account/pools |
$parms = array( "poolid"=>98708 ); $mrr->put("/account/profile/41818/0",$parms); $parms = array( "poolid"=>98709 ); $mrr->put("/account/profile/41818/1",$parms); $parms = array( "poolid"=>98710 ); $mrr->put("/account/profile/41818/2",$parms); $parms = array( "poolid"=>98711 ); $mrr->put("/account/profile/41818/3",$parms); $parms = array( "poolid"=>98712 ); $mrr->put("/account/profile/41818/4",$parms);
{ "success": true, "data": { "id": "41818", "success": true, "message": "Updated" } } { "success": true, "data": { "id": "41818", "success": true, "message": "Updated" } } { "success": true, "data": { "id": "41818", "success": true, "message": "Updated" } } { "success": true, "data": { "id": "41818", "success": true, "message": "Updated" } } { "success": true, "data": { "id": "41818", "success": true, "message": "Updated" } }
DELETE /account/profile/[ID]
Delete a specific pool profile
$mrr->delete("/account/profile/42281");
{ "success": true, "data": { "id": "42281", "success": true, "message": "Deleted" } }
PUT /account/pool/test
Test a pool to verify connectivity/functionality with MRR. This endpoint is now active. Simple or full test; Simple verifies connectivity to the host and port only. Full test takes in user, password and the algorithm type which is then used to pick the stratum type to check against the pool. extramethod is used to specify an ethhash/ether_stratum protocol version, default is auto detection. Test source can be specified as one of our available rig servers. Test may choose to fall back to simple test if there is a configuration failure. error array is used for internal error, error string in result may contain a description of any problem encountered.
Output: simple test returns 'source' test server; the 'dest' / destination pool; an 'error' code (usually 'none'); 'connection' is true if we were able to succesfully connect to the pool; 'executiontime' records how long the test took. A test call can take up to 10-20 seconds when all failures are present.
Output: full test contains all the same as simple plus; 'protocol' the chosen test protocol; if 'sub' is present then the protocol contains a mining subscription - true if sent valid response; 'auth' is true if the authorization response was accepted by the pool; if 'red' is present then the protocol may send a 'client.reconnect', if it is true this means the pool is incompatible with MRR; 'diffs' is true when pool has set mining difficulty, 'diff' is the difficulty it sent; 'work' is true when the pool has sent a valid work broadcast; 'ssl' is true if the pool tested as being ssl/tls compatible and the test used ssl/tls to connect; if 'xnonce' is present and true it means the pool accepts mining.extranonce.
A valid and complete test in which the pool is compatible with MRR: connection: true, sub: true, auth: true, red: false, diffs: true, diff: >0, work: true. Please do not abuse the test or hammer pools as they may block us and our miners!
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
method | Y | STRING | Can be one of 'simple' or 'full' | |
extramethod | N | STRING | esm0 | Currently intended to use for 'hashimotos/ubiqhash/etchash' algo type name / ether_stratum protocol. default is esm0(auto detect); can be [esm0,esm1,esm2,esm3]. |
type | Y/N | STRING | The algorithm type name, such as scrypt,sha256,hashimotos,x11. See /info/algos. This determnes the protocol used in the test. Required when using 'full' test method. | |
host | Y | STRING | Url or host address of the pool. Can include port. | |
port | Y/N | INT | Port to connect to the pool host, required if no port is set in the host parameter. | |
user | Y/N | STRING | User to attempt to authenticate with the pool. Required when using 'full' test method. | |
pass | Y/N | STRING | Password sent with authentication to the pool. Required when using 'full' test method. | |
source | N | STRING | us-central01 | Source MRR server to test from, one of [us-central01,us-east01,us-west01,us-nw01,us-south01,ca-tor01,ap-01,au-01,eu-uk01,eu-01,eu-ru01,eu-ru02,eu-de01,eu-de02,jp-01,sa-br01,us-tx01,hk-01,ru-kra01,in-01] |
//Pool url chosen at random $mrr->put("/account/pool/test",array("method" =>"simple","host" =>"de.minexmr.com:4444")); $mrr->put("/account/pool/test",array("method" =>"full","type" =>"scrypt","host" =>"europe.solomining.io","port" =>7777,"user" =>"1CounterpartyXXXXXXXXXXXXXXXUWLpVr","pass" =>"x","source" =>"ca-tor01"));
//Simple test { "success": true, "data": { "result": [ { "source": "us-central01.miningrigrentals.com", "dest": "de.minexmr.com:4444", "error": "none", "connection": true, "executiontime": 0.12031352 } ], "error": [] } } //Full test { "success": true, "data": { "result": [ { "source": "ca-tor01.miningrigrentals.com", "dest": "europe.solomining.io:7777", "protocol": "stratum", "connection": true, "sub": true, "auth": true, "red": false, "diffs": true, "diff": 2000, "work": true, "xnonce": false, "ssl": false, "error": "none", "executiontime": 0.728852493 } ], "error": [] } }
GET /account/pool
List saved pools
$mrr->get("/account/pool");
{ "success": true, "data": [ { "priority": 0, "type": "scrypt", "host": "pool.ipominer.com", "port": "3333", "user": "merc.1", "pass": "x", "status": "", "name": "ipominer", "id": "98708" }, { "priority": 0, "type": "scrypt", "host": "pool.ipominer.com", "port": "3333", "user": "merc.large", "pass": "x", "status": "", "name": "ipominer large", "id": "79817" } ] }
GET /account/pool/[ID1];[ID2].../
Get saved pools
$mrr->get("/account/pool/98708;79817");
{ "success": true, "data": [ { "priority": 0, "type": "scrypt", "host": "pool.ipominer.com", "port": "3333", "user": "merc.1", "pass": "x", "status": "", "name": "ipominer", "id": "98708" }, { "priority": 0, "type": "scrypt", "host": "pool.ipominer.com", "port": "3333", "user": "merc.large", "pass": "x", "status": "", "name": "ipominer large", "id": "79817" } ] }
PUT /account/pool
Create a saved pool
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
type | Y | STRING | Pool algo, eg: sha256, scrypt, x11, etc | |
name | Y | STRING | Name to identify the pool with | |
host | Y | STRING | Pool host, the part after stratum+tcp:// | |
port | Y | INT | Pool port, the part after the : in most pool host strings | |
user | Y | STRING | Your workername | |
pass | N | STRING | Worker password | |
notes | N | STRING | Additional notes to help identify the pool for you |
$parms = array( "name"=>"ipominer third", "type"=>"scrypt", "host"=>"pool.ipominer.com", "port"=>3333, "user"=>"merc.1", "pass"=>"x", "notes"=>"Just for testing" ); $mrr->put("/account/pool",$parms);
{ "success": true, "data": { "id": "103487" } }
PUT /account/pool/[ID1];[ID2]...
Update saved pools
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
name | N | STRING | Name to identify the pool with | |
host | N | STRING | Pool host, the part after stratum+tcp:// | |
port | N | INT | Pool port, the part after the : in most pool host strings | |
user | N | STRING | Your workername | |
pass | N | STRING | Worker password | |
notes | N | STRING | Additional notes to help identify the pool for you |
$parms = array( "notes"=>"Testing update", "host"=>"pool.ipominer.com", "port"=>3333, ); $mrr->put("/account/pool/98708;103487",$parms);
{ "success": true, "data": [ { "priority": 0, "type": "scrypt", "host": "pool.ipominer.com", "port": "3333", "user": "merc.1", "pass": "x", "status": "", "notes": "Testing update", "name": "ipominer", "id": "98708" }, { "priority": 0, "type": "scrypt", "host": "pool.ipominer.com", "port": "3333", "user": "merc.1", "pass": "x", "status": "", "notes": "Testing update", "name": "ipominer third", "id": "103487" } ] }
DELETE /account/pool/[ID1];[ID2]...
Delete saved pools
$mrr->delete("/account/pool/79817");
{ "success": true, "data": { "id": "79817", "success": true, "message": "Deleted" } }
GET /account/currencies
Get a list of currencies currently used for payments that are enabled/disabled for your account. If a currency is disabled for your account, you may not have access to some functions or data using that currency. We use this to enable or disable a currency on our platform, we may add or disable a currency at any time.
$mrr->get("/account/currencies");
{ "success": true, "data": { "currencies": [ { "name": "BTC", "enabled": true }, { "name": "LTC", "enabled": true }, { "name": "ETH", "enabled": true }, { "name": "BCH", "enabled": true }, { "name": "DOGE", "enabled": false } ] } }
This endpoint is active
GET /rig
Search for rigs on a specified algo. This is identical to the main rig list pages.
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
type | Y | STRING | Rig type, eg: sha256, scrypt, x11, etc | |
minhours | Filter the minmum hours of the rig | |||
minhours.min | N | INT | Minimum value to filter | |
minhours.max | N | INT | Maximum value to filter | |
maxhours | Filter the maximum hours of the rig | |||
maxhours.min | N | INT | Minimum value to filter | |
maxhours.max | N | INT | Maximum value to filter | |
rpi | Filter the RPI score | |||
rpi.min | N | INT | Minimum value to filter | |
rpi.max | N | INT | Maximum value to filter | |
hash | Filter the hashrate | |||
hash.min | N | INT | Minimum value to filter | |
hash.max | N | INT | Maximum value to filter | |
hash.type | N | STRING | The hash type of min/max. defaults to "mh", possible values: [hash,kh,mh,gh,th] | |
price | Filter the price | |||
price.min | N | INT | Minimum value to filter | |
price.max | N | INT | Maximum value to filter | |
offline | N | BOOLEAN | false | To show or not to show offline rigs |
rented | N | BOOLEAN | false | to show or not to show rented rigs |
region | Filter the region | |||
region.type | N | STRING | Determines if this filter is an inclusive or exclusive filter.. possible options are [include,exclude] | |
region.[REGION] | N | BOOLEAN | A region to include/exclude | |
count | N | INT | 100 | Number of results to return, max is 100 |
offset | N | INT | 0 | What result number to start with, returning COUNT results |
orderby | N | STRING | "score" | Field to order the results by. Default is "score", Possible values: [price,hashrate,minhrs,maxhrs,rpi,name,region,online,rented] |
orderdir | N | STRING | "asc" | Order direction |
$search = array( "count"=>1, //return 1 "type"=>"scrypt", //algo "currency"=>"LTC", //ltc only rigs "rpi"=>array( "min"=>50, "max"=>100 ), "minhours"=>array( "min"=>3, "max"=>50 ), "maxhours"=>array( "min"=>3, "max"=>50 ), "price"=>array( "min"=>0.000001, "max"=>0.0002 ), "hash"=>array( "min"=>20, "max"=>500, "type"=>"mh" ) ); $mrr->get("/rig",$search);
{ "success": true, "data": { "offset": 0, "count": 1, "total": "16", "stats": { "available": { "rigs": "333", "hash": { "hash": "446837945674", "type": "hash", "nice": "446.84G" } }, "rented": { "rigs": "386", "hash": { "hash": "220551317000", "type": "hash", "nice": "220.55G" } }, "prices": { "lowest": "0.00014902", "last_10": "0.00015778", "last": "0.00014902" } }, "records": [ { "id": "42965", "name": "a401", "owner": "mjgraham", "type": "scrypt", "status": { "status": "available", "hours": 0, "rented": false, "online": true }, "online": true, "xnonce": "no", "poolstatus": "online", "region": "us-east", "rpi": "100.00", "suggested_diff": "68665", "optimal_diff": { "min": "65612.793", "max": "393676.758" }, "ndevices": "1", "extensions": true, "price": { "type": "mh", "BTC": { "currency": "BTC", "price": "0.00000290", "hour": "0.00003319", "minhrs": "0.00019916", "maxhrs": "0.00026555", "enabled": true }, "LTC": { "currency": "LTC", "price": "0.00014902", "hour": "0.00170751", "minhrs": "0.01024506", "maxhrs": "0.01366008", "enabled": true }, "ETH": { "currency": "ETH", "price": "0.00006138", "hour": "0.00070326", "minhrs": "0.00421957", "maxhrs": "0.00562610", "enabled": true }, "DOGE": { "currency": "DOGE", "price": "0.00014902", "hour": "0.00170751", "minhrs": "0.01024506", "maxhrs": "0.01366008", "enabled": true } }, "minhours": "6", "maxhours": "8", "hashrate": { "advertised": { "hash": 275, "type": "mh", "nice": "275.00M" }, "last_5min": { "hash": "275.630", "type": "mh", "nice": "275.63M" }, "last_15min": { "hash": "265.286", "type": "mh", "nice": "265.29M" }, "last_30min": { "hash": "269.545", "type": "mh", "nice": "269.54M" } }, "description": null, "shorturl": "http:\/\/rig.rent\/rigs\/42965" } ] } }
GET /rig/mine
List my rigs
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
type | N | STRING | Filter on algo -- see /info/algos | |
hashrate | N | BOOLEAN | false | Calculate and display hashrates |
//Optional parameter $params = array( "type"=>"cryptonote" ); $mrr->get("/rig/mine",$params);
{ "success": true, "data": [ { "id": "49244", "name": "cntest", "owner": "merc", "type": "cryptonote", "status": { "status": "disabled", "hours": 0, "rented": false, "online": false }, "online": false, "xnonce": "no", "poolstatus": "unknown", "region": "us-central", "rpi": "new", "suggested_diff": "", "optimal_diff": { "min": "516.884", "max": "3101.304" }, "ndevices": "1", "extensions": true, "price": { "type": "mh", "BTC": { "currency": "BTC", "price": "7.76223000", "hour": "0.00323426", "minhrs": "0.00970279", "maxhrs": "0.31048920", "enabled": true, "autoprice": true, "modifier": 0 }, "LTC": { "currency": "", "price": 0, "hour": 0, "minhrs": 0, "maxhrs": 0, "enabled": false, "autoprice": false }, "ETH": { "currency": "", "price": 0, "hour": 0, "minhrs": 0, "maxhrs": 0, "enabled": false, "autoprice": false }, "DOGE": { "currency": "", "price": 0, "hour": 0, "minhrs": 0, "maxhrs": 0, "enabled": false, "autoprice": false } }, "minhours": "3", "maxhours": "96", "hashrate": { "advertised": { "hash": 0.01, "type": "mh", "nice": "10.00K" } }, "description": "Test Rig description for our API Demo", "available_status": "disabled", "riggroup": "0", "shorturl": "http:\/\/rig.rent\/rigs\/49244" } ] }
GET /rig/[ID1];[ID2];...
Get 1 or more rigs by ID
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
fields | N | STRING | Filter root level fields to include only those you define, ie: "status;rpi;region" |
$riglist = array("3635","15084"); $mrr->get("/rig/".implode(";",$riglist));
{ "success": true, "data": [ { "id": "3635", "name": "Mega-sha256 Marian-- 12.5--TH--very stable", "owner": "marian-sha256", "type": "sha256", "status": { "status": "disabled", "hours": 0, "rented": false, "online": true }, "online": true, "xnonce": "no", "poolstatus": "online", "region": "eu", "rpi": "84.94", "suggested_diff": "", "optimal_diff": { "min": "4850.638", "max": "29103.830" }, "ndevices": "6", "extensions": true, "price": { "type": "th", "BTC": { "currency": "BTC", "price": "0.00006900", "hour": "0.00003594", "minhrs": "0.00010781", "maxhrs": "0.00086250", "enabled": true }, "LTC": { "currency": "", "price": 0, "hour": 0, "minhrs": 0, "maxhrs": 0, "enabled": false }, "DOGE": { "currency": "", "price": 0, "hour": 0, "minhrs": 0, "maxhrs": 0, "enabled": false }, "ETH": { "currency": "", "price": 0, "hour": 0, "minhrs": 0, "maxhrs": 0, "enabled": false } }, "minhours": "3", "maxhours": "24", "hashrate": { "advertised": { "hash": 12.5, "type": "th", "nice": "12.50T" }, "last_5min": { "hash": "7.058", "type": "th", "nice": "7.06T" }, "last_15min": { "hash": "7.135", "type": "th", "nice": "7.13T" }, "last_30min": { "hash": "7.214", "type": "th", "nice": "7.21T" } }, "description": null, "shorturl": "http:\/\/rig.rent\/rigs\/3635" }, { "id": "15084", "name": "AntMiner S3 #3", "owner": "mps148", "type": "sha256", "status": { "status": "rented", "hours": "104.9797", "rented": true, "online": true }, "online": true, "xnonce": "no", "poolstatus": "online", "region": "eu", "rpi": "100.00", "suggested_diff": "", "optimal_diff": { "min": "153.668", "max": "922.009" }, "ndevices": "1", "extensions": true, "price": { "type": "th", "BTC": { "currency": "BTC", "price": "0.00009000", "hour": "0.00000025", "minhrs": "0.00000594", "maxhrs": "0.00004158", "enabled": true }, "LTC": { "currency": "LTC", "price": "0.01093560", "hour": "0.00003007", "minhrs": "0.00072175", "maxhrs": "0.00505225", "enabled": true }, "DOGE": { "currency": "", "price": 0, "hour": 0, "minhrs": 0, "maxhrs": 0, "enabled": false }, "ETH": { "currency": "ETH", "price": "0.00248963", "hour": "0.00000685", "minhrs": "0.00016432", "maxhrs": "0.00115021", "enabled": true } }, "minhours": "24", "maxhours": "168", "hashrate": { "advertised": { "hash": 0.066, "type": "th", "nice": "66.00G" }, "last_5min": { "hash": "0.111", "type": "th", "nice": "111.05G" }, "last_15min": { "hash": "0.107", "type": "th", "nice": "107.35G" }, "last_30min": { "hash": "0.088", "type": "th", "nice": "88.22G" } }, "description": null, "shorturl": "http:\/\/rig.rent\/rigs\/15084" } ] }
PUT /rig
Create a rig
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
name | Y | STRING | Name of rig | |
description | N | STRING/LONGTEXT | Description of the rig | |
status | N | STRING | "enabled","disabled" | |
server | Y | STRING | Server name -- see /info/servers | |
price.btc.enabled | N | BOOLEAN | true | Enable BTC Pricing |
price.btc.price | N | DOUBLE/STRING | Price of the rig per price.type per day (BTC) | |
price.btc.autoprice | N | BOOLEAN | Enable BTC autopricing | |
price.btc.minimum | N | DOUBLE/STRING | Minimum price for the autopricer -- 0 to disable | |
price.btc.modifier | N | STRING | Percent +/- to modify the autopricing (eg: +10 or -5.13 is 10% over or 5.13% under market rates, respectively), 0 to disable | |
price.ltc.enabled | N | BOOLEAN | true | Enable LTC Pricing |
price.ltc.price | N | DOUBLE/STRING | Price of the rig per price.type per day (LTC) | |
price.ltc.autoprice | N | BOOLEAN | Enable LTC autopricing -- adjusts the LTC rate based on your BTC price and the Coinbase market rate | |
price.eth.enabled | N | BOOLEAN | true | Enable ETH Pricing |
price.eth.price | N | DOUBLE/STRING | Price of the rig per price.type per day (ETH) | |
price.eth.autoprice | N | BOOLEAN | Enable ETH autopricing -- adjusts the ETH rate based on your BTC price and the Coinbase market rate | |
price.doge.enabled | N | BOOLEAN | true | Enable LTC Pricing |
price.doge.price | N | DOUBLE/STRING | Price of the rig per price.type per day (DOGE) | |
price.doge.autoprice | N | BOOLEAN | Enable DOGE autopricing -- adjusts the DOGE rate based on your BTC price and the Coinbase market rate | |
price.type | N | STRING | mh | The hash type of hash.. defaults to "mh" possible values: [hash,kh,mh,gh,th] |
minhours | N | FLOAT | Minimum number of hours available | |
maxhours | N | FLOAT | Maximum number of hours available | |
extensions | N | BOOLEAN | true | Enable or disable allowing rental extensions to be purchased |
hash.hash | N | DOUBLE/STRING | Amounto f hash to advertise | |
hash.type | N | STRING | mh | The hash type of hash.. defaults to "mh" possible values: [hash,kh,mh,gh,th] |
suggsted_diff | N | FLOAT | Suggested difficulty setting | |
ndevices | N | INT | Number of devices (workers) |
$parms = array( "name"=>"Test Create Rigtest1234", "hash"=>array( "hash"=>50, "type"=>"gh", ), "type"=>"scrypt", "server"=>"us-central01.miningrigrentals.com", "price"=>array( "type"=>"gh", "btc"=>array( "price"=>"0.1", "minimum"=>"0.0000005", "modifier"=>"-10", ), "ltc"=>array( "enabled"=>true, "autoprice"=>true ), "eth"=>array( "enabled"=>true, "autoprice"=>true ), "doge"=>array( "enabled"=>true, "autoprice"=>true ) ), "minhours"=>4, "maxhours"=>24, "status"=>"disabled" ); $mrr->put("/rig",$parms);
{ "success": true, "data": { "id": "62960", "name": "Test Create Rigtest1234", "owner": "merc", "type": "scrypt", "status": { "status": "disabled", "hours": 0, "rented": false, "online": true }, "online": true, "xnonce": "no", "poolstatus": "online", "region": "us-central", "rpi": "new", "suggested_diff": "", "optimal_diff": { "min": "4850.638", "max": "29103.830" }, "ndevices": "6", "extensions": true, "price": { "type": "mh", "BTC": { "currency": "BTC", "price": "0.00010000", "hour": "0.20833333", "minhrs": "0.83333333", "maxhrs": "5.00000000",, "enabled": true "autoprice": false, "autoprice_min": "0.0000000005", "autoprice_min_type": "1", "autoprice_modifier": "0", "autoprice_modifier_type": "0", }, "LTC": { "currency": "LTC", "price": "0.00597015", "hour": "12.43781250", "minhrs": "49.75125000", "maxhrs": "298.50750000", "enabled": true, "autoprice": true }, "ETH": { "currency": "ETH", "price": "0.00175408", "hour": "3.65433333", "minhrs": "14.61733333", "maxhrs": "87.70400000", "enabled": true, "autoprice": true }, "DOGE": { "currency": "DOGE", "price": "0.00597015", "hour": "12.43781250", "minhrs": "49.75125000", "maxhrs": "298.50750000", "enabled": true, "autoprice": true } }, "minhours": "4", "maxhours": "24", "hashrate": { "advertised": { "hash": 50000, "type": "mh", "nice": "50.00G" }, "last_5min": { "hash": "0.000", "type": "mh", "nice": "0.00" }, "last_15min": { "hash": "0.000", "type": "mh", "nice": "0.00" }, "last_30min": { "hash": "0.000", "type": "mh", "nice": "0.00" } }, "description": null, "shorturl": "http:\/\/rig.rent\/rigs\/62960" } }
POST /rig/batch
Update a batch of rigs using a 'rigs' array.
This endpoint accepts a single body element 'rigs', that element is to be an array of the following items:
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
id | Y | INT | Rig ID | |
status | N | STRING | "enabled","disabled" | |
name | N | STRING | Your rig's "name" as displayed on the site. | |
description | N | STRING/LONGTEXT | Description of the rig | |
price.btc.enabled | N | BOOLEAN | true | Enable BTC Pricing |
price.btc.price | N | DOUBLE/STRING | Price of the rig per price.type per day (BTC) | |
price.btc.autoprice | N | BOOLEAN | Enable BTC autopricing | |
price.btc.minimum | N | DOUBLE/STRING | Minimum price for the autopricer -- 0 to disable | |
price.btc.modifier | N | STRING | Percent +/- to modify the autopricing (eg: +10 or -5.13 is 10% over or 5.13% under market rates, respectively), 0 to disable | |
price.ltc.enabled | N | BOOLEAN | true | Enable LTC Pricing |
price.ltc.price | N | DOUBLE/STRING | Price of the rig per price.type per day (LTC) | |
price.ltc.autoprice | N | BOOLEAN | Enable LTC autopricing -- adjusts the LTC rate based on your BTC price and the Coinbase market rate | |
price.eth.enabled | N | BOOLEAN | true | Enable ETH Pricing |
price.eth.price | N | DOUBLE/STRING | Price of the rig per price.type per day (ETH) | |
price.eth.autoprice | N | BOOLEAN | Enable ETH autopricing -- adjusts the ETH rate based on your BTC price and the Coinbase market rate | |
price.doge.enabled | N | BOOLEAN | true | Enable DOGE Pricing |
price.doge.price | N | DOUBLE/STRING | Price of the rig per price.type per day (DOGE) | |
price.doge.autoprice | N | BOOLEAN | Enable DOGE autopricing -- adjusts the DOGE rate based on your BTC price and the Coinbase market rate | |
price.type | N | STRING | mh | The hash type of hash.. defaults to "mh" possible values: [hash,kh,mh,gh,th] |
minhours | N | FLOAT | Minimum number of hours available | |
maxhours | N | FLOAT | Maximum number of hours available | |
extensions | N | BOOLEAN | true | Enable or disable allowing rental extensions to be purchased |
hash.hash | N | DOUBLE/STRING | Amounto f hash to advertise | |
hash.type | N | STRING | mh | The hash type of hash.. defaults to "mh" possible values: [hash,kh,mh,gh,th] |
suggsted_diff | N | FLOAT | Suggested difficulty setting | |
ndevices | N | INT | Number of devices (workers) |
$parms = array( "rigs"=>array( array( "id"=>17, "price"=>array( "type"=>"kh", "BTC"=>array("price"=>0.00002739,"autoprice"=>false), "LTC"=>array("price"=>0.00361768,"autoprice"=>false); ) ), array( "id"=>49244, "price"=>array( "type"=>"kh", "BTC"=>array("price"=>0.00002512,"autoprice"=>false), ) ) ) ); $mrr->post("/rig/batch",$parms);
{ "success": true, "data": [ { "id": "17", "name": "Merc's 2x 7970-test", "owner": "merc", "type": "scrypt", "status": { "status": "offline", "hours": 0, "rented": false, "online": false }, "online": false, "xnonce": "no", "poolstatus": "offline", "region": "eu-de", "rpi": "new", "suggested_diff": "1024", "optimal_diff": { "min": "4850.638", "max": "29103.830" }, "ndevices": "1", "extensions": true, "price": { "type": "mh", "BTC": { "currency": "BTC", "price": "0.00002739", "hour": "0.00057054", "minhrs": "0.00171162", "maxhrs": "0.00798755", "enabled": true, "autoprice": false, "modifier": 0 }, "LTC": { "currency": "LTC", "price": "0.00361768", "hour": "0.07536833", "minhrs": "0.22610500", "maxhrs": "1.05515667", "enabled": true, "autoprice": false }, "DOGE": { "currency": "DOGE", "price": "0.00111992", "hour": "0.02333167", "minhrs": "0.06999500", "maxhrs": "0.32664333", "enabled": true, "autoprice": true }, "ETH": { "currency": "ETH", "price": "0.00086939", "hour": "0.01811238", "minhrs": "0.05433713", "maxhrs": "0.25357325", "enabled": true, "autoprice": true } }, "minhours": "3", "maxhours": "14", "hashrate": { "advertised": { "hash": 500, "type": "mh", "nice": "500.00M" }, "last_5min": { "hash": "0.000", "type": "mh", "nice": "0.00" }, "last_15min": { "hash": "0.000", "type": "mh", "nice": "0.00" }, "last_30min": { "hash": "0.000", "type": "mh", "nice": "0.00" } }, "description": "2x 7970 running modest settings to keep the heat down, but above advertised hashrate :)", "available_status": "available", "shorturl": "http:\/\/rig.rent\/rigs\/17" }, { "id": "49244", "name": "cntest", "owner": "merc", "type": "cryptonote", "status": { "status": "disabled", "hours": 0, "rented": false, "online": false }, "online": false, "xnonce": "no", "poolstatus": "offline", "region": "us-central", "rpi": "new", "suggested_diff": "", "optimal_diff": { "min": "4850.638", "max": "29103.830" }, "ndevices": "1", "extensions": true, "price": { "type": "kh", "BTC": { "currency": "BTC", "price": "0.00002512", "hour": "0.00000052", "minhrs": "0.00000157", "maxhrs": "0.00005024", "enabled": true, "autoprice": false, "minimum": "0.00000040", "modifier": "-1.5" }, "LTC": { "currency": "LTC", "price": "0.00349715", "hour": "0.00007286", "minhrs": "0.00021857", "maxhrs": "0.00699430", "enabled": true, "autoprice": false }, "DOGE": { "currency": "", "price": 0, "hour": 0, "minhrs": 0, "maxhrs": 0, "enabled": false, "autoprice": false }, "ETH": { "currency": "", "price": 0, "hour": 0, "minhrs": 0, "maxhrs": 0, "enabled": false, "autoprice": false } }, "minhours": "3", "maxhours": "96", "hashrate": { "advertised": { "hash": 0.0005, "type": "mh", "nice": "500.00" }, "last_5min": { "hash": "0.000", "type": "mh", "nice": "0.00" }, "last_15min": { "hash": "0.000", "type": "mh", "nice": "0.00" }, "last_30min": { "hash": "0.000", "type": "mh", "nice": "0.00" } }, "description": null, "available_status": "disabled", "shorturl": "http:\/\/rig.rent\/rigs\/49244" } ] }
DELETE /rig/[ID1];[ID2];...
Delete 1 or more rigs by ID
$mrr->delete("/rig/26996;27004;");
{ "success": true, "data": [ { "id": "26996", "success": true }, { "id": "27004", "success": true } ] }
PUT /rig/[ID1];[ID2];.../extend
For Rig Owners: Extend a rental to donate time to the renter -- Assuming an active rental is in progress. Extension length must be at least 1 minute (0.0166666666666666 hours). Inputs 'hours' and 'minutes' are additive to eachother, for example 0.23343 hours and 2 minutes, are added to the Extension length. Must have at least one of the arguments.
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
hours | N | FLOAT | Hours to extend by | |
minutes | N | FLOAT | Minutes to extend by |
$mrr->put("/rig/33/extend",array("hours" => 0.05, "minutes"=> 1.2)); $mrr->put("/rig/33;34/extend",array("hours" => 0.05, "minutes"=> 1.2));
//Single rig { "success": true, "data": { "id": "33", "success": true } } //Multiple rigs (more then one rig specified) { "success":true, "data":[{ "id:33,"success":true },{ "id:34,"success":true } ] } //Errors {"success":false,"data":{"message":"Missing either 'hours' or 'minutes'"}} {"success":false,"data":{"message":"Extension length must be at least 1 minute."}} {"success":false,"data":{"message":"Rig not found"}} //Data could also be an array of these objects with the same messages, see "Multiple rigs" {"success":true,"data":{"id:33,"success":false,"message":"Rig not found or no active rental"}} {"success":true,"data":{"id:33,"success":false,"message":"Could not get rental data associated with this rig. The rental may be too close to ending, or may have already expired."}} {"success":true,"data":{"id:33,"success":false,"message":"Could not extend, did you press button twice?"}}//Extended too fast {"success":true,"data":{"id:33,"success":false,"message":"Missing hours"}}
POST /rig/batch/extend
Batch endpoint - For Rig Owners: Extend a rental using a list of rigs in order to donate time to the renter -- Assuming an active rental is in progress. Extension length must be at least 1 minute (0.0166666666666666 hours). Inputs 'hours' and 'minutes' are additive to eachother, for example 0.23343 hours and 2 minutes, are added to the Extension length. Must have at least one of the arguments and are specified individually for each rig.
This endpoint accepts a single body element 'rigs', that element is to be an array of the following items:
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
id | Y | INT | Rig ID | |
hours | Y/N | FLOAT | Hours to extend by | |
minutes | Y/N | FLOAT | Minutes to extend by |
$parms = array( "rigs"=>array( array( "id"=>33, "hours" => 1, "minutes"=> 5 ), array( "id"=>22, "hours" => 1.523 ) ) ); $mrr->put("/rig/batch/extend",$parms);
{ "success":true, "data":[ { "id":33, "success":true }, { "id":22, "success":true } ] } //Errors - None of the rigs are located or some other error. {"success":false,"message":"Rig not found","data":{}} //Multiple rig error cases {"success":true,"data":[{"id:33,"success":false,"message":"Rig not found or no active rental"}]} {"success":true,"data":{["id:33,"success":false,"message":"Could not get rental data associated with this rig. The rental may be too close to ending, or may have already expired."}]} {"success":true,"data":{["id:33,"success":false,"message":"Could not extend, did you press button twice?"}]}//Extended too fast {"success":true,"data":{["id:33,"success":false,"message":"Missing hours"}]} {"success":true,"data":{["id:33,"success":false,"message":"Missing either 'hours' or 'minutes'"}]} {"success":true,"data":{["id:33,"success":false,"message":"Extension length must be at least 1 minute."}]} {"success":true,"data":{["id:33,"success":false,"message":"Rig not found"}]}
PUT /rig/[ID1];[ID2];.../profile
Apply a pool profile to one or more rigs
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
profile | Y | INT | Profile ID to apply -- see /account/profile |
$mrr->put("/rig/33/profile",array("profile" => 12345678));
{ "success": true, "data": { "id": "33", "success": true } }
GET /rig/[ID1];[ID2];.../pool
List pools assigned to one or more rigs.
$mrr->get("/rig/17/pool"); $mrr->get("/rig/26996;27004/pool");
{ "success": true, "data": { "rigid": "17", "pools": [ { "priority": "0", "type": "scrypt", "host": "pool.ipominer.com", "port": "3333", "user": "merc.1", "pass": "x", "status": "" } ] } } { "success": true, "data": [ { "rigid": "26996", "pools": [ { "priority": "0", "type": "scrypt", "host": "pool.ipominer.com", "port": "3333", "user": "merc.1", "pass": "x", "status": "" } ] }, { "rigid": "27004", "pools": [ { "priority": "0", "type": "scrypt", "host": "pool.ipominer.com", "port": "3333", "user": "merc.1", "pass": "x", "status": "" } ] } ] }
PUT /rig/[ID1];[ID2];.../pool
Add or replace a pool on one or more rigs
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
host | Y | STRING | pool host (the part after stratum+tcp://) | |
port | Y | INT | pool port (ex: 3333) | |
user | Y | STRING | workername | |
pass | Y | STRING | worker password | |
priority | N | INT | 0-4 -- can be passed in after pool/ instead. eg /rig/17/pool/0 |
$params = array( "host"=>"pool.ipominer.com", "port"=>"3333", "user"=>"merc.1", "pass"=>"x" ); $mrr->put("/rig/26996;27004/pool/0",$params); $params = array( "host"=>"pool.ipominer.com", "port"=>"3333", "user"=>"merc.1", "pass"=>"x", "priority"=>1, ); $mrr->put("/rig/17/pool",$params);
{ "success": true, "data": [ { "id": "26996", "success": true }, { "id": "27004", "success": true } ] } { "success": true, "data": { "id": "17", "success": true } }
DELETE /rig/[ID1];[ID2];.../pool
Delete a pool on one or more rigs
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
priority | Y | INT | 0-4 -- can be passed in after pool/ instead. eg /rig/17/pool/0 |
$mrr->delete("/rig/17/pool/0");
{ "success": true, "data": { "id": "17", "success": true } }
GET /rig/[ID1];[ID2];.../port
Get a direct port # to use inplace of 3333 when connecting to our servers.
$mrr->get("/rig/17/port");
{ "success": true, "data": { "rigid": "17", "port": 50503, "server": "eu-de01.miningrigrentals.com" } }
GET /rig/[ID1];[ID2];.../threads
Obtain a list of currently active threads for a rig or list of rigs. Note that information output can change depending on level of access, public, renter, or owner. If you are the renter of the rig, access changes to renter and you can see more information than public view for the rig. If you are the owner of the rig you can see all the information for your rig.
$mrr->get("/rig/17/threads");//One rig. $mrr->get("/rig/17;18/threads");//List of rigs.
{ "success": true, "data": [ { "rigid": "17", "access": "public", "threads": [ { "guid": "5:1564137200:RIG17EXAMPLE.132438:254", "difficulty": { "share": "512" }, "region": "eu", "miner": { "version": "bfgminer\/5.4.2-38-g106390a", "xnonce": "0" }, "hashrate": { "valid": 3276031.000576, "valid_nice": "3.28M" } } ] } ] }
{ "success": true, "data": [ { "rigid": "17", "access": "renter", "threads": [ { "shares": { "accepted": "788", "rejected": "1", "total": "790" }, "pool": { "rented": "0", "priority": "0" }, "errors": { "clientreconn": 0, "sickpool": 0, "maxbadshare": 0, "hostnotfound": 0, "misc": 0, "nopools": 0 }, "guid": "5:1564137200:RIG17EXAMPLE.132438:256", "difficulty": { "share": "512" }, "region": "eu", "miner": { "version": "bfgminer\/5.4.2-38-g106390a", "xnonce": "0" }, "hashrate": { "valid": 2598231.474176, "valid_nice": "2.60M" } } ] } ] }
{ "success": true, "data": [ { "rigid": "17", "access": "owner", "threads": [ { "shares": { "accepted": "795", "rejected": "1", "total": "797" }, "pool": { "rented": "0", "priority": "0" }, "errors": { "clientreconn": 0, "sickpool": 0, "maxbadshare": 0, "hostnotfound": 0, "misc": 0, "nopools": 0 }, "guid": "5:1564137200:RIG17EXAMPLE.132438:256", "difficulty": { "share": "512", "network": "11324141.292987" }, "region": "eu", "miner": { "version": "bfgminer\/5.4.2-38-g106390a", "xnonce": "0", "pass": "1,d=128", "ip": "127.0.0.1" }, "hashrate": { "valid": 3050097.8688, "valid_nice": "3.05M" } } ] } ] }
GET /rig/[ID1];[ID2];.../graph
Obtain a rigs graph information. Historical hashrate bars, average, rejected rate, rental periods, offline periods and pool offline periods. "bars","average","rejected" are all strings that contain [] delimited array, consisting of a unix timestamp in miliseconds followed by the numerical hashrate value. "rentals","offline","pooloffline" are comma delimited array, contain unix timestamps in miliseconds for start and end pair of each period seperated by : (colon). For current rigs the lastest timestamp will be the latest minute period processed by our system.
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
hours | N | FLOAT | 168 | Restrict graph data to the specified number of hours. 2 week maximum. |
deflate | N | BOOLEAN | FALSE | Base64 encode outputs to reduce bandwith. |
show_hashrate | N | BOOLEAN | TRUE | Filter for graph hashrate information. |
ignore_zerohashrate | N | BOOLEAN | FALSE | Filter out hashrate bar entries with 0 hashrate. |
$mrr->get("/rig/33/graph",array("hours" => 0.05));
{ "success": true, "data": { "rigid": "33", "chartdata": { "bars": "[1567400700000,1694498.816],[1567400760000,3106581.1626667],[1567400820000,2071054.1084444]", "average": "[1567400700000,1694498.816],[1567400760000,3106581.1626667],[1567400820000,2071054.1084444]", "rejected": "[1567400700000,0],[1567400760000,0],[1567400820000,0]", "rentals": "1603005720000:1603008720000,1567400760000:1567401360000", "offline": "1603005720000:1603008720000,1567400760000:1567401360000", "pooloffline": "1603005720000:1603008720000,1567400760000:1567401360000" }, "hashtype": "mh", "advertised": { "raw": "3200000.000", "hashtype": 3.2 } } }
This endpoint is active
GET /riggroup
Get a list of your rig groups
$mrr->get("/riggroup");
{ "success": true, "data": { "1147": { "id": "1147", "name": "My Group", "enabled": "1", "rental_limit": "1", "active_rentals": [] } } }
PUT /riggroup
Create a rig group
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
name | Y | STRING | A name to represent your rig group | |
enabled | N | BOOLEAN/INT | 1 | 1/true is enabled, 0/false is disabled. Disabling a rig group will prevent the rental triggers that disable other rigs in the group. |
rental_limit | N | INT | 1 | The number of active rentals allowed on a group before disabling the other rigs in the group (Typically this will always be 1) |
$mrr->put("/riggroup",array("name"=>"My Group","enabled"=>1,"rental_limit"=>1));
{ "success": true, "data": { "id": "3", "name": "My Group", "enabled": "1", "rental_limit": "1" } }
GET /riggroup/[ID]
Get a rig group's details
$mrr->get("/riggroup/1147");
{ "success": true, "data": { "id": "1147", "name": "My Group", "enabled": "1", "rental_limit": "1", "active_rentals": [], "rigs": [] } }
PUT /riggroup/[ID]
Update a rig group
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
name | N | STRING | A name to represent your rig group | |
enabled | N | BOOLEAN/INT | 1 | 1/true is enabled, 0/false is disabled. Disabling a rig group will prevent the rental triggers that disable other rigs in the group. |
rental_limit | N | INT | 1 | The number of active rentals allowed on a group before disabling the other rigs in the group (Typically this will always be 1) |
$mrr->put("/riggroup/123",array("name"=>"New Name","enabled"=>0,"rental_limit"=>1));
{ "success": true, "data": { "id": "3", "name": "New Name", "enabled": "0", "rental_limit": "1" } }
DELETE /riggroup/[ID]
Delete a rig group
$mrr->delete("/riggroup/3");
{ "success": true, "data": { "deleted": true } }
POST /riggroup/[ID]/add/[rigid1];[rigid2];[rigid3]...
Adds one or more rigs to your rig group. Note, rigs can only be part of one group at a time.
$mrr->post("/riggroup/3/add/17;49244;69825;108538");
{ "success": true, "data": { "id": "3", "name": "New Name", "enabled": "0", "rental_limit": "1", "rigs": [ { "id": "17", "name": "Merc's 2x 7970-test", "owner": "merc", "type": "scrypt", "status": { "status": "offline", "hours": 0, "rented": false, "online": false }, ... "ndevices": "1", "description": "2x 7970 running modest settings to keep the heat down, but above advertised hashrate :)", "available_status": "available", "shorturl": "http:\/\/rig.rent\/rigs\/17" }, { "id": "49244", "name": "cntest", "owner": "merc", "type": "cryptonote", "status": { "status": "disabled", "hours": 0, "rented": false, "online": false }, ... "ndevices": "1", "description": null, "available_status": "disabled", "shorturl": "http:\/\/rig.rent\/rigs\/49244" }, { "id": "69825", "name": "merctest", "owner": "merc", "type": "equihash", "status": { "status": "disabled", "hours": 0, "rented": false, "online": false }, ... "ndevices": "1", "description": null, "available_status": "disabled", "shorturl": "http:\/\/rig.rent\/rigs\/69825" }, { "id": "108538", "name": "zzz", "owner": "merc", "type": "mars", "status": { "status": "disabled", "hours": 0, "rented": false, "online": false }, ... "ndevices": "1", "description": null, "available_status": "disabled", "shorturl": "http:\/\/rig.rent\/rigs\/108538" } ] } }
POST /riggroup/[ID]/remove/[rigid1];[rigid2];[rigid3]...
Removes one or more rigs from your rig group. Note, rigs can only be part of one group at a time.
$mrr->post("/riggroup/3/remove/49244;69825;108538");
{ "success": true, "data": { "id": "3", "name": "New Name", "enabled": "0", "rental_limit": "1", "rigs": [ { "id": "17", "name": "Merc's 2x 7970-test", "owner": "merc", "type": "scrypt", "status": { "status": "offline", "hours": 0, "rented": false, "online": false }, ... "ndevices": "1", "description": "2x 7970 running modest settings to keep the heat down, but above advertised hashrate :)", "available_status": "available", "shorturl": "http:\/\/rig.rent\/rigs\/17" } ] } }
This endpoint is active
GET /rental
Note: Average hashrate information is removed over time. Historical rentals may show a 0% average hashrate even if they hashed properly. We prune this data to minimize storage space.
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
type | N | STRING | renter | Type is one of [owner,renter] -- owner means rentals on your rigs, renter means rentals you purchased |
algo | N | STRING | Filter by algo, see /info/algos | |
history | N | BOOLEAN | false | true = Show completed rentals, false = Active rentals |
rig | N | INT | Show rentals related to a specific rig ID | |
start | N | INT | 0 | Start number (for pagination) |
limit | N | INT | 25 | Limit number (for pagination) |
currency | N | STRING | Filter by rentals paid currency, one of (BTC,LTC,ETH,DOGE) |
$parms = array( "type"=>"renter", "history"=>1, "limit"=>1 ); $mrr->get("/rental",$parms);
{ "success": true, "data": { "total": "1530", "returned": 1, "start": 0, "limit": 1, "rentals": [ { "id": "1124219", "owner": "tompohl", "renter": "merc", "hashrate": { "advertised": { "hash": 540, "type": "mh", "nice": "540.00M" }, "average": { "hash": "568.625", "type": "mh", "nice": "568.63M" } }, "price": { "advertised": "0.00010843", "paid": "0.00731903", "currency": "ETH" }, "length": "3", "extended": "0", "start": "2017-12-13 02:46:05 UTC", "end": "2017-12-13 08:46:05 UTC", "rig": { "id": "51283", "name": "Overclocked Antminer L3+ 540Mh | Central US | Difficulty =65535 | Rigged for your pleasure, 550MH\/s", "owner": "tompohl", "type": "scrypt", "status": { "status": "available", "hours": 0 }, "region": "us-central", "rpi": "99.83", "price": { "BTC": { "currency": "BTC", "price": "0.00000587", "hour": "0.00013208", "minhrs": "0.00079245", "maxhrs": "0.02218860" }, "LTC": { "currency": "LTC", "price": "0.00033296", "hour": "0.00749149", "minhrs": "0.04494893", "maxhrs": "1.25856990" }, "ETH": { "currency": "ETH", "price": "0.00012108", "hour": "0.00272432", "minhrs": "0.01634594", "maxhrs": "0.45768618" }, "DOGE": { "currency": "DOGE", "price": "0.00033296", "hour": "0.00749149", "minhrs": "0.04494893", "maxhrs": "1.25856990" } }, "minhours": "6", "maxhours": "168", "hashrate": { "advertised": { "hash": 540, "type": "mh", "nice": "540.00M" } }, "worker_id": "50219", "shorturl": "http:\/\/rig.rent\/rigs\/51283" } } ] } }
GET /rental/[ID1];[ID2];...
$mrr->get("/rental/3676300");
{ "success": true, "data": { "id": "3676300", "owner": "rammer", "renter": "merc", "hashrate": { "advertised": { "hash": "17", "type": "th", "nice": "17.00T" }, "average": { "hash": "11.925962352629", "type": "th", "nice": "11.93T", "percent": "70.15" } }, "price": { "type": "legacy", "advertised": "0.00000520", "paid": "0.00001105", "currency": "BTC" }, "price_converted": { "type": "th", "advertised": "0.00000520", "currency": "BTC" }, "length": "3", "extended": "0", "extensions": [], "start": "2022-03-02 15:37:03 UTC", "end": "2022-03-02 18:37:03 UTC", "ended": true, "refunded": true, "rig": { "id": "153561", "name": "S9 SE - Rammer 05", "owner": "rammer", "type": "sha256", "status": { "status": "rented", "hours": "9.1619", "rented": true, "online": true, "rental_id": "3703107" }, "online": true, "xnonce": "no", "poolstatus": "online", "region": "eu", "rpi": "94.68", "suggested_diff": "", "optimal_diff": { "min": "27939.677", "max": "167638.063" }, "ndevices": "1", "device_memory": null, "extensions": true, "price": { "type": "th", "BTC": { "currency": "BTC", "price": "0.00000529", "hour": "0.000002645000", "minhrs": "0.00000794", "maxhrs": "0.00006348", "enabled": true }, "LTC": { "currency": "", "price": 0, "hour": 0, "minhrs": 0, "maxhrs": 0, "enabled": false }, "DOGE": { "currency": "", "price": 0, "hour": 0, "minhrs": 0, "maxhrs": 0, "enabled": false }, "ETH": { "currency": "", "price": 0, "hour": 0, "minhrs": 0, "maxhrs": 0, "enabled": false }, "BCH": { "currency": "", "price": 0, "hour": 0, "minhrs": 0, "maxhrs": 0, "enabled": false } }, "minhours": "3", "maxhours": "24", "hashrate": { "advertised": { "hash": 12, "type": "th", "nice": "12.00T" }, "last_5min": { "hash": "15.617", "type": "th", "nice": "15.62T" }, "last_15min": { "hash": "13.014", "type": "th", "nice": "13.01T" }, "last_30min": { "hash": "10.737", "type": "th", "nice": "10.74T" } }, "description": "", "available_status": "available", "shorturl": "http:\/\/rig.rent\/rigs\/153561", "device_ram": "0" } } }
PUT /rental
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
rig | Y | INT | Rig ID to rent | |
length | Y | FLOAT | Length in hours to rent | |
profile | Y | INT | The profile ID to apply (see /account/profile | |
currency | N | STRING | BTC | Currency to use -- one of [BTC,LTC,ETH,DOGE] |
rate.type | N | STRING | The hash type of rate. defaults to "mh", possible values: [hash,kh,mh,gh,th] | |
rate.price | N | FLOAT | Price per [rate.type] per day to pay -- this is a filter only, it will use the rig's current price as long as it is <= this value |
$parms = array( "rig"=>41784, "length"=>3, "rate"=>array( "type"=>"mh", "price"=>0.00021344, ), "currency"=>"BTC", "profile"=>40073, ); $mrr->put("/rental",$parms);
{ "success": true, "data": { "id": "1170089", "owner": "aricee23", "renter": "merc", "hashrate": { "advertised": { "hash": 600, "type": "mh", "nice": "600.00M" }, "average": { "hash": "0.000", "type": "mh", "nice": "0.00" } }, "price": { "advertised": "0.00000279", "paid": "0.00020927", "currency": "BTC" }, "length": "3", "extended": "0", "start": "2017-12-28 19:21:04 UTC", "end": "2017-12-28 22:21:04 UTC", "rig": { "id": "41784", "name": "l3 600MH\/s 20 Overclocked", "owner": "aricee23", "type": "scrypt", "status": { "status": "rented", "hours": "3.0" }, "region": "us-east", "rpi": "100.00", "price": { "BTC": { "currency": "BTC", "price": "0.00000279", "hour": "0.00006976", "minhrs": "0.00020927", "maxhrs": "0.00334829" }, "LTC": { "currency": "LTC", "price": "0.00016648", "hour": "0.00416205", "minhrs": "0.01248615", "maxhrs": "0.19977840" }, "ETH": { "currency": "ETH", "price": "0.00005554", "hour": "0.00138846", "minhrs": "0.00416537", "maxhrs": "0.06664584" }, "DOGE": { "currency": "DOGE", "price": "0.00016648", "hour": "0.00416205", "minhrs": "0.01248615", "maxhrs": "0.19977840" } }, "minhours": "3", "maxhours": "48", "hashrate": { "advertised": { "hash": 600, "type": "mh", "nice": "600.00M" }, "last_5min": { "hash": "627.924", "nice": "627.92M", "type": "mh" }, "last_15min": { "hash": "685.357", "nice": "685.36M", "type": "mh" }, "last_30min": { "hash": "667.439", "nice": "667.44M", "type": "mh" } }, "worker_id": "40720", "shorturl": "http:\/\/rig.rent\/rigs\/41784" } } }
PUT /rental/[ID1];[ID2];.../profile
Apply a pool profile to one or more rentals
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
profile | Y | INT | Profile ID to apply -- see /account/profile |
$mrr->put("/rental/1170089/profile/40073");
{ "success": true, "data": { "id": "1170089", "success": true } }
GET /rental/[ID1];[ID2];.../pool
List pools assigned to one or more rentals.
$mrr->get("/rental/17/pool"); $mrr->get("/rental/26996;27004/pool");
{ "success": true, "data": { "rigid": "17", "pools": [ { "priority": "0", "type": "scrypt", "host": "pool.ipominer.com", "port": "3333", "user": "merc.1", "pass": "x", "status": "" } ] } } { "success": true, "data": [ { "rigid": "26996", "pools": [ { "priority": "0", "type": "scrypt", "host": "pool.ipominer.com", "port": "3333", "user": "merc.1", "pass": "x", "status": "" } ] }, { "rigid": "27004", "pools": [ { "priority": "0", "type": "scrypt", "host": "pool.ipominer.com", "port": "3333", "user": "merc.1", "pass": "x", "status": "" } ] } ] }
PUT /rental/[ID1];[ID2];.../pool
Add or replace a pool on one or more rentals
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
host | Y | STRING | pool host (the part after stratum+tcp://) | |
port | Y | INT | pool port (ex: 3333) | |
user | Y | STRING | workername | |
pass | Y | STRING | worker password | |
priority | N | INT | 0-4 -- can be passed in after pool/ instead. eg /rig/17/pool/0 |
$params = array( "host"=>"pool.ipominer.com", "port"=>"3333", "user"=>"merc.1", "pass"=>"x" ); $mrr->put("/rental/26996;27004/pool/0",$params); $params = array( "host"=>"pool.ipominer.com", "port"=>"3333", "user"=>"merc.1", "pass"=>"x", "priority"=>1, ); $mrr->put("/rental/17/pool",$params);
{ "success": true, "data": [ { "id": "26996", "success": true }, { "id": "27004", "success": true } ] } { "success": true, "data": { "id": "17", "success": true } }
DELETE /rental/[ID1];[ID2];.../pool
Delete a pool on one or more rentals
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
priority | Y | INT | 0-4 -- can be passed in after pool/ instead. eg /rig/17/pool/0 |
$mrr->delete("/rental/17/pool/0");
{ "success": true, "data": { "id": "17", "success": true } }
PUT /rental/[ID1];[ID2];.../extend
Purchase an extension on one more rentals
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
length | Y | FLOAT | Length in hours to purchase an extension for. | |
getcost | N | ANY | If defined, the API will simulate the extension. |
$mrr->put("/rental/1983609/extend",array("length" => 0.05, "getcost"=> true)); $mrr->put("/rental/1983609/extend",array("length" => 0.05));
{ "success": true, "data": [ { "rentalid": "1983609", "rigid": "41183", "maxhrs": "720", "current_hrs": 3.25, "currency": "DOGE", "rate": { "price": "0.00071339", "hashrate": 1.7, "type": "mh" }, "cost": "0.00000258", "success": true, "new_hrs": 3.3, "message": "Not extended.", } ] } { "success": true, "data": [ { "rentalid": "1983609", "rigid": "41183", "maxhrs": "720", "current_hrs": 3.25, "currency": "DOGE", "rate": { "price": "0.00071339", "hashrate": 1.7, "type": "mh" }, "cost": "0.00000258", "success": true, "new_hrs": 3.3 } ] }
GET /rental/[ID1];[ID2];.../graph
Obtain a rental graph information. Historical hashrate bars, average, rejected rate, rental periods, offline periods and pool offline periods. "bars","average","rejected" are all strings that contain [] delimited array, consisting of a unix timestamp in miliseconds followed by the numerical hashrate value. "offline","pooloffline" are comma delimited array, contain unix timestamps in miliseconds for start and end pair of each period seperated by : (colon). "rentals" is always none. time_start and time_end contain textual display of start and end time of the rental. Please note that for long rentals it can take some time to generate a graph, and even longer if you select more then one of them so please be sparing in the use of this.
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
deflate | N | BOOLEAN | FALSE | Base64 encode outputs to reduce bandwith. |
show_hashrate | N | BOOLEAN | TRUE | Filter for graph hashrate information. |
ignore_zerohashrate | N | BOOLEAN | FALSE | Filter out hashrate bar entries with 0 hashrate. |
$mrr->get("/rental/3000000/graph",array());
{ "success": true, "data": { "rentalid": "3000000", "chartdata": { "time_start": "2020-10-18 00:16:07", "time_end": "2020-10-18 10:34:07", "bars": "[1567400700000,1694498.816],[1567400760000,3106581.1626667],[1567400820000,2071054.1084444]", "average": "[1567400700000,1694498.816],[1567400760000,3106581.1626667],[1567400820000,2071054.1084444]", "rejected": "[1567400700000,0],[1567400760000,0],[1567400820000,0]", "rentals": "none", "offline": "1603005720000:1603008720000,1567400760000:1567401360000", "pooloffline": "1603005720000:1603008720000,1567400760000:1567401360000" }, "hashtype": "mh", "advertised": { "raw": "3200000.000", "hashtype": 3.2 } } }
GET /rental/[ID1];[ID2];.../log
Obtain 'Activity Log' detail messages on one or more of your rentals. Your view will depend on if you are the renter, or the rig owner. Return data is an array if more then one rental is requested, if single rental then the log is not in an array.
$mrr->get("/rental/2645931;3558171/log");
{ "success": true, "data": [ { "rentalid": "2645931", "view": "renter", "rental_log": [ { "id": "16989536", "time": "2020-01-28 22:26:01 UTC", "msg": "Rental #2645931 has finished." }, { "id": "16989533", "time": "2020-01-28 22:25:11 UTC", "msg": "A refund for rental #2645931 has been issued by support." }, { "id": "16988915", "time": "2020-01-28 21:16:20 UTC", "msg": "Rental #2645931 has started." }, { "id": "16988913", "time": "2020-01-28 21:16:20 UTC", "msg": "Rental #2645931 has been successfully paid for." }, { "id": "16988904", "time": "2020-01-28 21:15:25 UTC", "msg": "Rental request #2645931 has been created." } ] }, { "rentalid": "3558171", "view": "owner", "rental_log": [ { "id": "25207479", "time": "2021-12-27 18:36:01 UTC", "msg": "Rental #3558171 has finished." }, { "id": "25206227", "time": "2021-12-27 15:35:08 UTC", "msg": "Rental #3558171 has started." }, { "id": "25206225", "time": "2021-12-27 15:35:08 UTC", "msg": "Credit for rental #3558171 has been successfully processed." } ] } ] }
GET /rental/[ID1];[ID2];.../message
Obtain messages on one or more of your rentals.
$mrr->get("/rental/3000000/message");
{ "success": true, "data": { "rentalid": "3000000", "messages": [{ "username": "..", "is_admin": "..", "is_support": "..", "when": "..", "message": "..", }] } }
PUT /rental/[ID1];[ID2];.../message
Send a message to one or more of your rentals.
Path | Required | Data Type | Default | Info |
---|---|---|---|---|
message | Y | STRING | The message to add to a rental. |
$mrr->put("/rental/3000000/message",array("Thank you."));
{ "success": true, "data": [{ "id": "3000000", "success": true }] }
This endpoint is active
GET /pricing
$mrr->get("/pricing");
{ "success": true, "data": { "conversion_rates": { "LTC": "0.00270800", "ETH": "0.06918000", "BCH": "0.00728900", "DOGE": "0.00237400" }, "market_rates": { "allium": { "BTC": "0.00001037", "LTC": "0.00382930", "ETH": "0.00014990", "BCH": "0.00142266", "DOGE": "0.00436805" }, "argon2dchukwa": { "BTC": "0.00140839", "LTC": "0.52008619", "ETH": "0.02035839", "BCH": "0.19322176", "DOGE": "0.59325755" }, ... } } }
PHP example code
class mrr { //Root URI for the api public $root_uri = "https://www.miningrigrentals.com/api/v2"; public $decode = true; public $pretty = false; public $print = false; private $key; private $secret; function __construct($key,$secret) { //define the api_key and api_secret on construct $this->key = $key; $this->secret = $secret; } //Raw query function -- includes signing the request function query($type,$endpoint,$parms=array()) { $ch = curl_init(); $rest = ""; //if there is any url params, remove it for the signature if(strpos($endpoint,"?")!==false){ $arr = explode("?",$endpoint); $endpoint = $arr[0]; $rest = "?".$arr[1]; } //URI is our root_uri + the endpoint $uri = $this->root_uri.$endpoint.$rest; switch($type) { case 'GET': $parms = json_encode($parms); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($type)); curl_setopt($ch, CURLOPT_POSTFIELDS, $parms); break; case 'POST': $parms = json_encode($parms); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $parms); break; case 'DELETE': case 'HEAD': case 'PUT': $parms = json_encode($parms); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $parms); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($type)); break; default: curl_setopt($ch, CURLOPT_CUSTOMREQUEST, strtoupper($type)); curl_setopt($ch, CURLOPT_POSTFIELDS, $parms); } if($this->pretty) { if(strpos($uri,"?") == false) $uri.='?pretty'; else $uri.="&pretty"; } //Get an incrementing/uinque nonce $mtime = explode(' ',microtime()); $nonce = $mtime[1].substr($mtime[0], 2, 4); //String to sign is api_key + nonce + endpoint $sign_string = $this->key.$nonce.$endpoint; //Sign the string using a sha1 hmac $sign = hash_hmac("sha1", $sign_string, $this->secret); //Headers to include our key, signature and nonce $headers = array( 'Content-Type: application/json', 'x-api-key: '.$this->key, 'x-api-sign: '.$sign, 'x-api-nonce: '.$nonce, ); //Curl request curl_setopt($ch, CURLOPT_URL,$uri); curl_setopt($ch, CURLOPT_ENCODING, ''); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MRR API PHP client; '.php_uname('s').'; PHP/'.phpversion().')'); $response = curl_exec($ch); $info = curl_getinfo($ch); curl_close($ch); //echo $parms."\n"; if($this->print) { echo "$type $uri\n"; } return array( 'status'=>$info['http_code'], 'header'=>trim(substr($response,0,$info['header_size'])), 'data'=>substr($response,$info['header_size']) ); } function parseReturn($array) { $data = array(); if($array["status"] != 200) { $data = $array; }else { if($this->decode) $data = json_decode($array["data"],true); else $data = $array["data"]; } if($this->print) { echo "\nReturned Data::\n"; if(is_array($data)) print_r($data); else echo $data; echo "\n"; } else { return $data; } } //helper aliases just to make things easier function get($endpoint,$parms=array()) { return $this->parseReturn($this->query("GET",$endpoint,$parms)); } function post($endpoint,$parms=array()) { return $this->parseReturn($this->query("POST",$endpoint,$parms)); } function put($endpoint,$parms=array()) { return $this->parseReturn($this->query("PUT",$endpoint,$parms)); } function delete($endpoint,$parms=array()) { return $this->parseReturn($this->query("DELETE",$endpoint,$parms)); } } $key = "YOURKEY"; $secret = "YOURSECRET"; $mrr = new mrr($key,$secret); $mrr->decode=false; $mrr->pretty=true; $mrr->print=true; //Test connectivity $mrr->get("/whoami");