HTTP API

With HTTP API you can get the number of hashes solved for a user account on your website, withdraw hashes, verify tokens.

Using this API requires a secret key (see Dashboard > Keys). This key should be kept secret and should never be exposed to your users. The HTTP API should only ever be called from the server side, i.e. from PHP, NodeJS, Ruby, Python scripts running on your own server.

Note: you should never call the HTTP API from the client side.

Your secret key can be passed with each API call as a GET parameter.

The API returns a JSON encoded object for each request. All responses contain a status property. In case success is false, an error property will be present, describing why the operation failed.

We have pretty simple but very useful PHP library to make API calls, you can download ithere.

All api calls are going with specific rules:

https://webminepool.com/api/{secret_key}/{method_name}/{method_param_1}/{?method_param_2}
? - means parameter is optional

/set_token/{hashes_amount}/{?username}

URL: https://webminepool.com/api/{secret_key}/set_token/{hashes_amount}/{?username}

Method creates a token with a goal needed to achieve by user or whole account. This can be useful if you want to reward your users for certain actions. Can be checked by /get_token/{token_id}/{?unset}

Parameters

secret_key Your secret key, can check here on Dashboard > Keys
hashes_amount The number of hashes this token must have reached in order to be valid.
username *optional if you want to create token for certain user, otherwise token will be created for you api_key, like a goal to achieve

Response

{
    "success": true|false,  //was creation successfull or error ocured
    "token_id": string,  //token ID to access token for verification
    "message": string // optional, will present in responce if status will be "error"
}

/get_token/{token_id}/{?unset}

URL: https://webminepool.com/api/{secret_key}/get_token/{token_id}/{?unset}

Method gets a token to check it. In case if token were verified by system (goal was reached) you'll get "status": 1 in response. Otherwice status will return 0. Can be seted up by /set_token/{hashes_amount}/{?username}

Parameters

secret_key Your secret key, can check here on Dashboard > Keys
token_id You can get it when creating token by /set_token/{hashes_amount}/{?username}
unset *Optional. Trigger to delete token (as well as user) right after verification to avoid doublepassing. Very useful using captcha like actions.

Response

{
    "success":true,   //was getting successfull or error ocured
    "state": 0|1, //1 if token verified and 0 if not
    "end_hashes": number, //number of last hash needed to reach by user(account). It's sum of his hashes (on the moment of token creating) and needed hashes seted up with /set_token/
    "done_at": //info about time token were updated with a timezone (creation time if unverified or verification time if verified)
    {
        "date":string,
        "timezone_type":number,
        "timezone":string
    }
}

/users/

URL: https://webminepool.com/api/{secret_key}/users/

Method gets a list of users with their balances.

Parameters

secret_key Your secret key, can check here on Dashboard > Keys

Response

{
    "success":true|false, //was request successfull or not
    "users": //list of users
    [
        {
            "api_key":string, //public site_key this user connected to
            "name":string, //username
            "hashes":number //hashes balance
        },
        {
            "api_key":string, //public site_key this user connected to
            "name":string, //username
            "hashes":number //hashes balance
        }
    ]
}

Note: this function returns only users who mined within last 3 days (to avoid overwhelming if you have a lot of inactive users).

/create_user/{username}/{?referral}

URL: https://webminepool.com/api/{secret_key}/create_user/{username}/{?referral}

Method creates user and allows to set up user referral. This is the only way to add additional information to user.
Users are still creating automatically when starting mining.

Parameters

secret_key Your secret key, can check here on Dashboard > Keys
username Username of needed user
referral *Optional. Name of user referral (or any other additional information related to user).

Response

{
    "success":true|false, //was request successfull or not
    "message": string //server responce with creating confirmation or error description
}

/delete_user/{username}

URL: https://webminepool.com/api/{secret_key}/delete_user/{username}

Method is used to delete user from our database.

Parameters

secret_key Your secret key, can check here on Dashboard > Keys
username Username of needed user

Response

{
    "success":true|false, //was request successfull or not
    "message": string //server responce with deletion confirmation or error description
}

/user_hashes/{username}

URL: https://webminepool.com/api/{secret_key}/user_hashes/{username}

Method gets hashes balance of certain user.

Parameters

secret_key Your secret key, can check here on Dashboard > Keys
username Username of needed user

Response

{
    "success":true|false, //was request successfull or not
    "hashes":number //user's hashes amount
}

/withdraw/{username}/{amount}

URL: https://webminepool.com/api/{secret_key}/withdraw/{username}/{amount}

Method allowing to withdraw certain amount of hashes from user.

Parameters

secret_key Your secret key, can check here on Dashboard > Keys
username Username of needed user
amount Amount of hashes you want to withdraw

Response

{
    "success":true|false, //was request successfull or not
    "message":string //message with success confirmation or error description
}

/reset_user_hashes/{username}

URL: https://webminepool.com/api/{secret_key}/reset_user_hashes/{username}

Method decreases user's balance to zero.

Parameters

secret_key Your secret key, can check here on Dashboard > Keys
username Username of needed user

Response

{
    "success":true|false, //was request successfull or not
    "message":string //message confirms that user's balance is zero
}

/reset_all_user_hashes

URL: https://webminepool.com/api/{secret_key}/reset_all_user_hashes

Method decreases all user's balances to zero.

Parameters

secret_key Your secret key, can check here on Dashboard > Keys

Response

{
    "success":true|false, //was request successfull or not
    "message":string //message confirms that user's balance is zero
}

/balance

URL: https://webminepool.com/api/{secret_key}/balance

Method gets your account balance

Parameters

secret_key Your secret key, can check here on Dashboard > Keys

Response

{
    "success":true|false, //was request successfull or not
    "balance":number //account balance in WMC
}

/hashes

URL: https://webminepool.com/api/{secret_key}/hashes

Method gets your account upaid hashes amount

Parameters

secret_key Your secret key, can check here on Dashboard > Keys

Response

{
    "success":true|false, //was request successfull or not
    "hashes":number //unpaid hashes amount (total hashes amount coming soon)
}

/wmc_rate

URL: https://webminepool.com/api/{secret_key}/wmc_rate/{?amount}

Method converts needed amount of WMC to BTC satoshi (1 by default).

Parameters

secret_key Your secret key, can check here on Dashboard > Keys
amount *optional (Equal 1 if not set). Amount of wmc you want to convert.

Response

{
    "success":true|false, //was request successfull or not
    "satoshi":number //current amount of satoshi for wmc (amount entered)
}

/hash_rate

URL: https://webminepool.com/api/{secret_key}/hash_rate/{?amount}

Method converts needed amount of hashes (mined via web mining) to BTC satoshi (1000000 by default).

Parameters

secret_key Your secret key, can check here on Dashboard > Keys
amount *optional (Equal 1 if not set). Amount of hashes you want to convert.

Response

{
    "success":true|false, //was request successfull or not
    "satoshi":number //current amount of satoshi for wmc (amount entered)
}

/hash_rate_cli

URL: https://webminepool.com/api/{secret_key}/hash_rate_cli/{?amount}

Method converts needed amount of hashes (mined via CLI (desktop) mining) to BTC satoshi (1000000 by default).

Parameters

secret_key Your secret key, can check here on Dashboard > Keys
amount *optional (Equal 1 if not set). Amount of hashes you want to convert.

Response

{
    "success":true|false, //was request successfull or not
    "satoshi":number //current amount of satoshi for wmc (amount entered)
}

Possible errors list

Error message Error description
nonexistent token Token you are trying to get doesn't exist. Seems like was never created or you made an error in token_id.
invalid api key You made an error in secret_key. Maybe you already deleted it or refreshed, check out this page Dashboard > Keys
internal error Internal server error, please contact support with detailed information what you did to get this.
Comodo SSL