The By Bits APIs have three different environments (mock, sandbox and production) that can be defined in the headers of API requests.

Mock environment


The mock endpoints allows developers to build with the API without having an account with By Bits.

A mock service is accessible via the same root endpoint https://api.bybits.co.uk but the environment headers = 'mock'. The value of the client_id and client_secret don't matter.

The mock services return dummy data that has the same type (i.e. string, integers, boolean) and schema as the actual API.

Mock endpoints are used to help quickly evaluate and test API functionality. They can be also used to do mock testing in your own application.

{
    "url": "https://api.bybits.co.uk/policys",
    "headers": {
        "client_secret": "11111-22222-33333-44444",
        "client_id": "11111-22222-33333-44444",
        "environment": "mock"
    },
    "method": "GET"
}

Sandbox environment


The sandbox services return test data that has the same type (i.e. string, integers, boolean) and schema as the actual API. The test data sits independent of production data and allows testing in confidence, particularly around authentication and scoping.

You should use this environment, along with the mock environment, to help develop with confidence before using production endpoints.

The environment = 'sandbox' and the client_secret header must be the correct client_secret key for sandbox. This can be found in the By Bits admin dashboard under Users.

{
    "url": "https://api.bybits.co.uk/policys",
    "headers": {
        "client_secret": "sandbox-22222-33333-44444",
        "client_id": "11111-22222-33333-44444",
        "environment": "sandbox"
    },
    "method": "GET"
}

Production environment

The production services return real data. You should only use production endpoints when you are comfortable you have sufficiently tested all your API integrations.

The environment = 'production' and the client_secret header must be the correct client_secret key for production. This can be found in the By Bits admin dashboard under Users.

{
    "url": "https://api.bybits.co.uk/policys",
    "headers": {
        "client_secret": "production-22222-33333-44444",
        "client_id": "11111-22222-33333-44444",
        "environment": "production"
    },
    "method": "GET"
}