ProBit API Documentation

The probit Developer Hub

Welcome to the probit developer hub. You'll find comprehensive guides and documentation to help you start working with probit as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Authorization

In order to access your account through our HTTP or WebSocket API, you need to specify your OAuth Access Token with the request.

Here's a rough guide for obtaining Access Tokens. Please refer to the OAuth 2.0 standard for the full details.

  1. Create an OAuth Client ID for your application: Login to probit website with your ID, and click the "
    API Settings" button in "My Page". Click the "Create new key" button and copy the "Client ID" and "Client Secret Key". Keep it secret. Anyone who have this key have the full access to your account.

  2. Get an OAuth Access Token using POST /token API with the Client ID/Secret from Step 1(Example 1). Put this Access Token to the "Authorization" HTTP header to access your accounts(Example 2). Access Tokens expire after a few minutes, so you need to fetch a new Access Token before it expires. Expiration time can be found in the "expires_in" field of the POST /token API.

To access Probit Global accounts: Create your OAuth Client ID from https://www.probit.com/.
To access Probit Korea accounts: Create your OAuth Client ID from https://www.probit.kr/.
API endpoints are same for both Probit Global and Probit Korea: https://api.probit.com/ and https://accounts.probit.com/token.

📘

Authorization APIs have different addresses than other HTTP APIs.
Default endpoint: https://accounts.probit.com/token

Example 1. Retrieving an Access Token from Client ID and Client Secret.

const getToken = async () => {
    const authHeader = 'Basic ' + Base64.encode(`${apiClientId}:${apiClientSecret}`);

    const resp = await fetch('https://accounts.probit.com/token', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'Authorization': authHeader
        },
        body: JSON.stringify({
            grant_type: 'client_credentials'
        })
    });

    if (!resp.ok) {
        throw new Error(resp.statusText);
    }

    return resp.json();
};

Example 2. Using the "balance" API with Access Token to fetch your account balances.

const getBalance = async () => {
    const accessToken = (await getToken()).access_token;

    const resp = await fetch('https://api.probit.com/api/exchange/v1/balance', {
        method: 'GET',
        headers: {
            'Content-Type': 'application/json',
            'Authorization': 'Bearer ' + accessToken
        }
    });

    if (!resp.ok) {
        throw new Error(resp.statusText);
    }

    return resp.json();
};

getBalance().then((balances) => console.log(balances));

Updated 7 months ago

Authorization


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.