How to get an API key for Bybit (SPOT/Deriv trades)

This page explains how to get an API key for Bybit's transaction history (SPOT and Deriv).

Please refer to here to check how different Bybit trade types (updated as needed) can be uploaded.

■If you have Bybit trade history previously uploaded using trade history files, Cryptact would look at the timestamp on the last transaction uploaded via the files and fetch any transactions after that via the API.

If you wish to use both files and API for trade history, please refer to here.



1. API key is valid only for 3 months
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. Historical transactions
For Bybit/API, it is unknown how far back in history it can get the data from. For file export, the specification is that you can export up to two years of data. For trade history that cannot be obtained via the API, you need to either download the exchange file and upload it, or upload as custom trades before establishing the API connection.

3. For transaction types not supported by API nor files, use custom trades
Bybit transaction types such as convert history, airdrops, "flexible staking orders" and "launch pools" are not supported by API nor files. Please upload them as custom trades.

4. Always do a final check
If the transactions fetched via the API and the transactions in the downloaded file are different, Cryptact cannot determine which is more accurate. Please check the transaction details by yourself thoroughly after they are fetched via the API. If you find any missing transactions, please send us the downloaded file and the API details via the Support button at the bottom right. We will check the details.


・If you previously uploaded trade history using files, the API would only fetch any new trades since the most recent timestamp.

・If you wish to leverage both files and API to load trade history, please refer here.


■How to get API key

① After logging in, click on the Person icon and select "API". mceclip0.png


② Click on "API Management" tab. In the "API Key" section, click "Create New Key".



③ 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. Set the Type to "Permission" to turn on the permission.

6. Click "Submit".



④ Fill out your 2FA code and click "Submit". mceclip4.png


⑤ Generated API key and API secret will be displayed on the screen.

    Make sure you note them down!

    * 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.




■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.

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.

   * Deleting the API will not delete the trade history from your ledger.


2. Create a new API key

For details on how to do this, please refer to here.


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".


* If you have deleted the trade history fetched by the previous API, you can set the subaccount to anything you like.


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.