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
Create an API Key at API Management.
Click ‘Create API Key’, name your key, and enter the security authentication code correctly.
Save the API Key and API Secret in a secure location.
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.
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
URL
Request method: such as POST, GET, etc.
Request header: functions like a letterhead or subject line.
Request body: contains all the details, similar to the content of a letter.
2. API response from the Bitkub’s server to the user
Response header
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:
Secure = These REST APIs require an API Key and API Secret to verify the user’s identity before granting access to the service.
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
Market data = Used to view market information.
Order = Used to manage orders.
Deposit & withdraw = Used to create withdrawals and retrieve deposit and withdrawal history.
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
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:
GET - asks: to retrieve data from the red order book.
GET - bids: to retrieve data from the green order book.
In this case, he can use non-secure REST API endpoints since he only needs general information.
Next, he checks his account’s available balance by using the ‘balances’ endpoint.
He then decides to place a buy order and uses the ‘place-bid’ endpoint.
Later, he wants to review his pending orders, so he uses the ‘my-open-order’ endpoint.
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
Feedback sent
We appreciate your effort and will try to fix the article