This page explains how to get an API key for Bybit's transaction history.
1. Important Notes
1.1 Historical transactions
Please be sure to check here for more details about our support for Bybit.
Due to the specifications of the API of the exchange, it is not clear from which point in time transaction history can be obtained.
- For Classic accounts, it has been confirmed with Bybit Support Desk that only the history of the past 180 days can be obtained (as of 2023/12/1).
- For Unified Trading accounts, it has been confirmed with Bybit Support Desk that history for the past 2 years can be obtained. However, the period for obtaining history after upgrading from a Classic account to an Unified Trading account is not certain, so please confirm the details with the exchange (as of 2023/12/1).
- However, it has been announced that transaction history files can be obtained for the past 2 years. For history that cannot be obtained via API, please download and upload the transaction history file or upload it with a custom file. If history cannot be obtained from either API or file, please upload it with "Custom File."
1.2 API key validity
Bybit/API expires in 3 months, therefore, you need to create a new API key and re-establish the connection every 3 months. For details on how to do this, please refer to here.
NEW: On January 19th, 2023, we have made our IP open to the public. You can now set up your API to have no expiry. For details on how to set this up, please refer to here.
2. How to get API key
After logging in, click on the Person icon and select "API".
Click on "API Management" tab. In the "API Key" section, click "Create New Key".
Please select "System-generated API Keys".
In the next screen, do the following.
1. Select "API transaction".
2. Set "Name for the API key" to whatever you want to call your API key.
3. Set API Key Permissions to "Read-Only".
4. Select "Only IPs with permissions granted are allowed to access the OpenAPI" and enter the below IP.
5. Click on "Standard Acount" or"Unified Trading"based on your own account.
6. Click "Submit".
Fill out your 2FA code and click "Submit".
Generated API key and API secret will be displayed on the screen.
The API key and API secret are displayed only once upon creation. You will not be able to check them after this time. If you miss this opportunity, you will have to create another API key.
If you previously synced with an API that had a validity period of 3 months, and later removed that API integration, and now you want to sync with a new API without an expiration date through cryptact, please make sure to enter the same sub-account name as before. If it was not set previously, please leave it blank. Please be aware that if a different sub-account name is added, it will result in duplicated spot trading history.
3. How to renew API every 3 months
NEW: On January 19th, 2023, we have made our IP open to the public. You can now set up your API to have no expiry. For details on how to set it up this way, please refer to the above.
3.1. Delete the existing API
Delete the API listed on the Connect to your Bybit account screen.
Please remember the subaccount name you previously used for the API (in the below example, "test") before deleting it.If you added the API with an empty subaccount name, it would be displayed as blank. Please note that deleting the API will not delete the trade history from your ledger.
3.2 Create a new API key
For details on how to do this, please refer to here.
3.3 Add the newly created API key
Connect to Bybit using the API key you have created in the above step.
Please use the same subaccount name you have previously used. You can just leave it blank if you did not use any subaccount name previously. Please note that if you use a different subaccount name, you will end up with duplicate SPOT trade history.
▼If there is any trade history previously uploaded via files, the datetime will be displayed on the screen. Please tick the checkbox before clicking "Submit".
4. Connect via Bybit API
Add API connectivity to Bybit by entering the generated API key and secret via Connect to your exchanges
Please note that we will not be held responsible for any damages caused by unauthorized use or other accidents due to API connections. When connecting, please be sure to use the API key specified by us.