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.

The API key is valid only for 3 months if you follow the instructions below. Please renew your key every 3 months.

When you are re-establishing API connection using a newly created API key, please use the same subaccount name that you previously used (or leave it blank if you previously left it blank) so that Cryptact knows the two API keys are for the same Bybit account. This way, you can ensure Cryptact does not fetch transactions that were previously fetched using the old API key.

According to the API specification, only transactions for the last 6 months can be fetched via the API. If you have trade history older than 6 months, please upload them as custom trades before establishing the API connection.

As of March 10, 2022, Cryptact also supports fetching Derivatives trade history via Bybit API.

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

(* However, if you have trade history previously uploaded using special files that our customer support used to provide in the past, Cryptact does not look at the timestamp of these transactions. In this case, you will end up with duplicate trade history. Please delete the trade history uploaded via these files before establishing the API connection.)

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.

If the transactions fetched via the API and the transactions in the downloaded file are different, we cannot determine which is more accurate. Please check the transaction details 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.

 

■How to get API key

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

 

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

mceclip1.png

 

3. In the next screen, do the following.

① Enter name (e.g. Cryptact).

② Select "Read-only".

③ For Contract, select "Positions"

④ For USDC Contracts, select "USDC Derivatives Trading"

⑤ For SPOT, select "Trade"

⑥ For "IP Access to API keys", click "All IPs"

⑦ Click "Submit"

 

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

 

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

* The API key and API secret are displayed only once upon creation. Please copy them and keep them somewhere safe. If you miss this opportunity, you will have to create another API key.

mceclip5.png

 

* For those who were using the API to fetch SPOT trade history before March 10, 2022

As of March 10, 2022, Deriv trade history can also be fetched via the API. If you wish to use the API to also fetch the Deriv trade history going forward, please take the following actions.

 

①Delete the existing API key

Delete the API listed on 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.

 

②Get a new API that can fetch Deriv trade history also

Log in to Bybit and create a new API key with permission to fetch both SPOT and Derivatives history. For details on how to do this, please refer to here.

 

③Re-establish API connection

Connect to Bybit using the API key you have created in ②. Please use the same subaccount name you have previously used. If you did not use any subaccount name previously, you can just leave it blank. Please note that if you use a different subaccount name, you will end up with duplicate SPOT trade history.

If you have previously uploaded Deriv trade history using files downloaded from the exchange, Cryptact would look at the timestamp on the last transaction uploaded via the files and fetch any transactions after that via the API. For further details, please refer to here.

If there is any Deriv trade history previously uploaded via files, the datetime will be displayed on the screen. Please tick the checkbox before clicking "Submit".

 

Connect via Bybit API

Add API connectivity to Bybit by entering the generated API key and secret via Connect to your exchanges

 

Disclaimer

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.