Skip to main content

Creating API Keys

To start trading, you need to create API keys.

BEFORE YOU START, YOU NEED TO ENABLE TWO-FACTOR AUTHENTICATION

How to create an API key​

  1. Go to Profile → API keys → Create API key.
  2. Come up with a name for the key.
  3. Set permissions for the key:
    • Read only. A key with no trading features.
    • Read & write. A key with trading enabled.
    • Spot trading. Provides access to spot trading.
    • Futures trading. Provides access to futures trading.
  4. Set IP access restrictions:
    • Unlimited access from any IP. Using the key allows you to connect from any IP address. Not recommended.
    • Only trusted IP addresses. The connection will only be available from the specified IP addresses. Recommended setting, even if third parties got access to your key, they won't be able to use it without the device or proxy with this IP address.
  5. Trusted IP addresses:
    • Enter address.
    • Click Add.
    • You can add multiple addresses.
  6. Confirm adding the key with two one-time codes.
    • Code from your email.
    • Code from Google Authenticator.
  7. Save the keys.

After confirmation, you will see the created API key. To trade, you will need both the public key and the secret key.

caution

THE SECRET KEY IS ONLY SHOWN ONCE. IF YOU DID NOT COPY THE SECRET KEY, YOU CAN DELETE THE CREATED API KEY AND CREATE A NEW ONE. Never store keys unencrypted or share them with others.

Restricting access by IP address​

Used to further protect your keys from unauthorized access. When restricted by IP, keys can only be used from a registered address.

BYBIT LIMITS THE LIFETIME OF ALL API KEYS WITHOUT IP ADDRESS RESTRICTIONS TO 90 DAYS.

Please note that you will need your external IP. Otherwise, trading functions will not work. Here are examples of addresses that are not suitable for setting restrictions.

If your address has a similar subnet mask

Intranet addresses: 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16

Addresses for internal use: 127.0.0.0/8 – used for communications within the host (see localhost).