Basic Information of API, REST API, and Use Cases

Modified on Fri, 9 Aug at 10:51 AM

What is API?


API stands for Application Programming Interface, a system that enables two systems to communicate with each other (through requests and responses), such as between a user's desktop and a company's server.


Customers who wish to use the Bitkub Exchange API must have completed at least level-1 account verification.


Before using the API, users should be aware of the following:

  • Do not share your API Key and API Secret with anyone to prevent unauthorized access to your account information and unauthorized transactions.

  • The latency for data transmission between the API and the server - from the time data leaves the user's system, reaches the company's server, and returns - is typically around 100 to 500 milliseconds (ms) or microseconds [1,000 ms = 1 second].


API Key and API Secret


  • An API Key is an ID or personal code used to identify the user, functioning like a username when accessing an online service. 

  • An API Secret is used to authenticate the ownership of each API, similar to a password.


How to Start Using the API


  1. Create an API Key at API Management.

  2. Click ‘Create API Key’, name your key, and enter the security authentication code correctly.

  3. Save the API Key and API Secret in a secure location.

    1. Keep in mind that the API Secret will be displayed only once, so be sure to copy or note it down and keep it securely.

  4. Set the permissions for your API Key.

  • 1 API Key can be used with up to 50 specific IPs.

  • Examples of permissions

    • Read: Allows the API to access and read the account information (basic permission). 

    • Trade: Allows the API to manage trading transactions.

    • Withdraw: Allows the API to manage withdrawal transactions.

    • Deposit: Allows the API to manage deposit transactions.



Components of API


1. API on the user’s side

  1. URL

  2. Request method: such as POST, GET, etc.

  3. Request header: functions like a letterhead or subject line. 

  4. Request body: contains all the details, similar to the content of a letter.


2. API response from the Bitkub’s server to the user

  1. Response header

  2. Response body


REST API


A REST API, short for Representational State Transfer, is a common method for transmitting data between users and a company’s server through an API, often referred to as an "endpoint." Each API serves a specific function, and multiple APIs can be used to perform different tasks.


Examples of REST API Request Methods 

  • GET = Used to retrieve data.

  • POST = Typically used to add or create new data, but it can also be used to retrieve information in certain cases, such as checking order details, etc.

  • DELETE = Used to remove data.


Types of REST APIs on Bitkub Exchange

There are 2 types: 

  1. Secure = These REST APIs require an API Key and API Secret to verify the user’s identity before granting access to the service.

  2. Non-secure = These REST APIs are used to request general information and do not require an API Key or API Secret for access.


Examples of REST API Usage on Bitkub Exchange

  1. Market data = Used to view market information.

  2. Order =  Used to manage orders.

  3. Deposit & withdraw =  Used to create withdrawals and retrieve deposit and withdrawal history.

  4. Account =  Used to retrieve account information and wallet addresses. 


For more details about APIs, including how to check the base URL, endpoint categories, and more, please visit the API document.


Examples of Use Cases


  1. Mr. Bullkub logs in to his Bitkub account and wants to check the market price of the ABC token. To do this, he uses the following APIs:

    1. GET - asks: to retrieve data from the red order book.

    2. GET - bids: to retrieve data from the green order book.

    3. In this case, he can use non-secure REST API endpoints since he only needs general information.

  2. Next, he checks his account’s available balance by using the ‘balances’ endpoint.

  3. He then decides to place a buy order and uses the ‘place-bid’ endpoint.

  4. Later, he wants to review his pending orders, so he uses the ‘my-open-order’ endpoint.

  5. Finally, he chooses to cancel the order using the ‘cancel-order’ endpoint.


Related articles

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article