BCF offers Level referral commissions for Everyone.Our Partner programmes assures loan and produces viable clients for Affiliate patnership .When your Balance gets to 0.30usd you can use.
Learn MoreBCF is a Proffessional Investment Corporation That Engages in Stock, Foreign Exchange Market ,Forex Market and Gold Trading.
Learn MoreOur Live Dashboard Allows You To Manage Your Account Easily .All The
Invest now and be assured of a lifetime of exquisite financial Insurance .Why wait?
BCF offers a Market Making Incentive Scheme for professional liquidity providers. Key benefits of this program include: Market Maker rebate. Monthly rewards as many as 30,000 LTE for the market maker with the best performance. Direct Market Access and Co-location service. Users with good maker strategies and huge trading volume are welcome to participate in this long-term program. If your account has a trading volume of more than 5000 BTC in the last 30 days on any exchange, please send the following information via email to mm@BCFGLOBAL.com, with subject "Spot Market Maker Application": One BCF account ID (a non-referred account is required). Proof of volume traded on any exchange within the past 30 days. Proof of a VIP level is also acceptable. A brief explanation of your market making method (NO detail is needed), as well as estimation of maker orders’ percentage.
Getting Started Introduction Welcome to BCF'S trader and developer documentation. These documents outline the exchange functionality, market details, and APIs. Our APIs are separated into two parts: REST API and Websocket feed. The REST API contains four categories: User(private) , Trade(private), Market Data(public), Others(public) The WebSocket contains two categories: Public Channels and Private Channels Private APIs require authentication and provide access to placing orders and other account information. WebSocket APIs provide market data, most of them are public. Reading Guide 1.Read Sandbox to learn how to debug the API in the test environment. 2.Read REST API to learn how to build a request. 3.Read Time if you want to make a test request (and receive a sample response) without having to authorize. 4.Read Authentication to learn how to make an authorized request. 5.Read InnerRead Sandbox to learn how to debug the API in the test environment. 6.Read REST API to learn how to build a request. 7.Read Time if you want to make a test request (and receive a sample response) without having to authorize. 8.Read Authentication to learn how to make an authorized request. 9.Read Inner Read Inner Transfer to see how to transfer assets. 10.Read List Accounts to test your authorized request. 11.Read Place a new order to see how to place an order. 12.Read Order Book to get a snapshot of the order book. 13.Read Websocket Feed to learn how to establish a websocket connection. 14.Read Level-2 Market Data to see how to build a local real-time order book with websocket. 15,Read Account balance notice to see how to get a private websocket feed and get real time notice of balance changes.
REST API Base URL The REST API has endpoints for account and order management as well as public market data. The base url is https://BCFGLOBAL.com. The request URL needs to be determined by BASE and specific endpoint combination. ENDPOINT Each interface has its own endpoint, described by field HTTP REQUEST in the docs. For the GET METHOD API, the endpoint needs to contain the query parameters string. e.g. For "List Accounts", the default endpoint of this API is /api/v1/accounts. If you pass the "currency" parameter(BTC), the endpoint is /api/v1/accounts?currency=BTC and the final request url is https://openapi-v2.BCFGLOBAL.com/api/v1/accounts?currency=BTC. Request All requests and responses are application/json content type. Unless otherwise stated, all timestamp parameters should in milliseconds. e.g. 1544657947759 Parameters For the GET, DELETE request, all query parameters need to be included in the request url. (e.g. /api/v1/accounts?currency=BTC) For the POST, PUT request, all query parameters need to be included in the request body with JSON. (e.g. {"currency":"BTC"}). Do not include extra spaces in JSON strings. Data Parameters All interfaces may add new parameters in the future, existing parameters will not change, please pay attention to compatibility during programming. Errors Errors forto bad requests will respond with an HTTP error code or system error code. The body will also contain a message parameter indicating the cause. HTTP error status codes HTTP error status codes { "code": "400100", "msg": "Invalid Parameter." } Code Meaning 400 Bad Request -- Invalid request format. 401 Unauthorized -- Invalid API Key. 403 Forbidden -- The request is forbidden. 404 Not Found -- The specified resource could not be found. 405 Method Not Allowed -- You tried to access the resource with an invalid method. 415 Unsupported Media Type. You need to use: application/json. 429 Too Many Requests -- Access limit breached. 500 Internal Server Error -- We had a problem with our server. Try again later. 503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later. System error codes Code Meaning 400001 Any of KC-API-KEY, KC-API-SIGN, KC-API-TIMESTAMP, KC-API-PASSPHRASE is missing in your request header 400002 KC-API-TIMESTAMP Invalid -- Your time differs from the server time by more than 5 seconds 400003 KC-API-KEY doesn’t exist 400004 KC-API-PASSPHRASE error 400005 Signature error -- Please check your signature 400006 The requested IP address is not in the API whitelist 400007 Access Denied -- Your API-key does not have sufficient permissions to access the URL 404000 Url Not Found -- The requested resource could not be found 400100 Parameter Error -- You tried to access the resource with invalid parameters 411100 User is frozen -- The user is frozen, please contact us via support center. 500000 Internal Server Error -- We had a problem with our server. Try again later. If the returned HTTP status code is 200, whereas the operation failed, an error will occur. You can check the above error code for details. Success A successful response is indicated by an HTTP status code 200 and system code 200000. The success response is as follows: { "code": "200000", "data": "1544657947759" } Pagination BCF uses pagination for all REST requests which return arrays. Pagination allows for fetching results with the current page and is well suited for real-time data. Endpoints like /api/v1/trades, /api/v1/fills, /api/v1/orders, return the latest items by default. To retrieve more results, subsequent requests should specify the direction in which to paginate, based on the data previously returned. PARAMETERS Parameter Default Description currentPage 1 Current request page. pageSize 50 Number of results per request.The minimum pageSize is 10 and maximum is 500. EXAMPLE GET /api/v1/orders?currentPage=1&pageSize=50 Types Timestamps Unless otherwise specified, all timestamps from API are returned in milliseconds(e.g. 1546658861000). Most modern languages and libraries will handle this without issues. But you need to be aware that the timestamps between the matching engine and the order system are in nanoseconds. Numbers Decimal numbers are returned as strings in order to preserve the full precision across platforms. When making a request, it is recommended that you also convert your numbers to strings to avoid truncation and precision errors. ion Generating an API Key Before being able to sign any requests, you must create an API key via the BCF website. Upon creating a key you will have 3 pieces of information which you must remember: Key Secret Passphrase The Key and Secret will be randomly generated and provided by BCF. The passphrase is filled in when you create the API. be cautious as the passphrase you create cannot be recovered if forgotten, you can only apply for a new API key again. BCF stores a salted hash of your passphrase for verification. Permissions You can restrict the functionality of API keys. Before creating the key, you must choose what permissions you would like the key to have. The permissions are: General - Allows key general permissions. This includes all GET endpoints. Trade - Allows a key to create orders, as well as retrieve trade data. This includes POST /api/v1/orders and several GET endpoints. Transfer - Allows a key to transfer currency on behalf of an account, including deposits and withdraws. Enable with caution - API key transfers WILL BYPASS two-factor authentication. Please refer to the documentation below to see what API key permissions are required for a specific route. Creating a Request All private REST requests must contain the following headers: KC-API-KEY The API key as a string. KC-API-SIGN The base64-encoded signature (see Signing a Message). KC-API-TIMESTAMP A timestamp for your request. KC-API-PASSPHRASE The passphrase you specified when creating the API key. Signing a Message <?php class API { public function __construct($key, $secret, $passphrase) { $this->key = $key; $this->secret = $secret; $this->passphrase = $passphrase; } public function signature($request_path = '', $body = '', $timestamp = false, $method = 'GET') { $body = is_array($body) ? json_encode($body) : $body; // Body must be in json format $timestamp = $timestamp ? $timestamp : time() * 1000; $what = $timestamp . $method . $request_path . $body; return base64_encode(hash_hmac("sha256", $what, $this->secret, true)); } } ?> #Example for get balance of accounts in python api_key = "api_key" api_secret = "api_secret" api_passphrase = "api_passphrase" url = 'https://openapi-sandbox.kucoin.com/api/v1/accounts' now = int(time.time() * 1000) str_to_sign = str(now) + 'GET' + '/api/v1/accounts' signature = base64.b64encode( hmac.new(api_secret.encode('utf-8'), str_to_sign.encode('utf-8'), hashlib.sha256).digest()) headers = { "KC-API-SIGN": signature, "KC-API-TIMESTAMP": str(now), "KC-API-KEY": api_key, "KC-API-PASSPHRASE": api_passphrase } response = requests.request('get', url, headers=headers) print(response.status_code) print(response.json()) #Example for create deposit addresses in python url = 'https://openapi-sandbox.kucoin.com/api/v1/deposit-addresses' now = int(time.time() * 1000) data = {"currency": "BTC"} data_json = json.dumps(data) str_to_sign = str(now) + 'POST' + '/api/v1/deposit-addresses' + data_json signature = base64.b64encode( hmac.new(api_secret.encode('utf-8'), str_to_sign.encode('utf-8'), hashlib.sha256).digest()) headers = { "KC-API-SIGN": signature, "KC-API-TIMESTAMP": str(now), "KC-API-KEY": api_key, "KC-API-PASSPHRASE": api_passphrase, "Content-Type": "application/json" # specifying content type or using json=data in request } response = requests.request('post', url, headers=headers, data=data_json) print(response.status_code) print(response.json()) For the header of KC-API-KEY, * Use API-Secret to encrypt the prehash string {timestamp+method+endpoint+body } with sha256 HMAC. The request body is a JSON string and need to be the same with the parameters passed by the API. * After that, use base64-encode to encrypt the result in step 1 again. Notice: * The encrypted timestamp shall be consistent with the KC-API-TIMESTAMP field in the request header. * The body to be encrypted shall be consistent with the content of the Request Body. * The Method should be UPPER CASE. * For GET, DELETE request, the endpoint needs to contain the query string. e.g. /api/v1/deposit-addresses?currency=XBT. The body is " " if there is no request body (typically for GET requests). #Example for Create Deposit Address curl -H "Content-Type:application/json" -H "KC-API-KEY:5c2db93503aa674c74a31734" -H "KC-API-TIMESTAMP:1547015186532" -H "KC-API-PASSPHRASE:Abc123456" -H "KC-API-SIGN:7QP/oM0ykidMdrfNEUmng8eZjg/ZvPafjIqmxiVfYu4=" -X POST -d '{"currency":"BTC"}' http://openapi-v2.kucoin.com/api/v1/deposit-addresses KC-API-KEY = 5c2db93503aa674c74a31734 KC-API-SECRET = f03a5284-5c39-4aaa-9b20-dea10bdcf8e3 KC-API-PASSPHRASE = Abc123456 TIMESTAMP = 1547015186532 METHOD = POST ENDPOINT = /api/v1/deposit-addresses STRING-TO-SIGN = 1547015186532POST/api/v1/deposit-addresses{"currency":"BTC"} KC-API-SIGN = 7QP/oM0ykidMdrfNEUmng8eZjg/ZvPafjIqmxiVfYu4= Signing a Message <?php class API { public function __construct($key, $secret, $passphrase) { $this->key = $key; $this->secret = $secret; $this->passphrase = $passphrase; } public function signature($request_path = '', $body = '', $timestamp = false, $method = 'GET') { $body = is_array($body) ? json_encode($body) : $body; // Body must be in json format $timestamp = $timestamp ? $timestamp : time() * 1000; $what = $timestamp . $method . $request_path . $body; return base64_encode(hash_hmac("sha256", $what, $this->secret, true)); } } ?> #Example for get balance of accounts in python api_key = "api_key" api_secret = "api_secret" api_passphrase = "api_passphrase" url = 'https://openapi-sandbox.kucoin.com/api/v1/accounts' now = int(time.time() * 1000) str_to_sign = str(now) + 'GET' + '/api/v1/accounts' signature = base64.b64encode( hmac.new(api_secret.encode('utf-8'), str_to_sign.encode('utf-8'), hashlib.sha256).digest()) headers = { "KC-API-SIGN": signature, "KC-API-TIMESTAMP": str(now), "KC-API-KEY": api_key, "KC-API-PASSPHRASE": api_passphrase } response = requests.request('get', url, headers=headers) print(response.status_code) print(response.json()) #Example for create deposit addresses in python url = 'https://openapi-sandbox.kucoin.com/api/v1/deposit-addresses' now = int(time.time() * 1000) data = {"currency": "BTC"} data_json = json.dumps(data) str_to_sign = str(now) + 'POST' + '/api/v1/deposit-addresses' + data_json signature = base64.b64encode( hmac.new(api_secret.encode('utf-8'), str_to_sign.encode('utf-8'), hashlib.sha256).digest()) headers = { "KC-API-SIGN": signature, "KC-API-TIMESTAMP": str(now), "KC-API-KEY": api_key, "KC-API-PASSPHRASE": api_passphrase, "Content-Type": "application/json" # specifying content type or using json=data in request } response = requests.request('post', url, headers=headers, data=data_json) print(response.status_code) print(response.json()) For the header of KC-API-KEY, * Use API-Secret to encrypt the prehash string {timestamp+method+endpoint+body } with sha256 HMAC. The request body is a JSON string and need to be the same with the parameters passed by the API. * After that, use base64-encode to encrypt the result in step 1 again. Notice: * The encrypted timestamp shall be consistent with the KC-API-TIMESTAMP field in the request header. * The body to be encrypted shall be consistent with the content of the Request Body. * The Method should be UPPER CASE. * For GET, DELETE request, the endpoint needs to contain the query string. e.g. /api/v1/deposit-addresses?currency=XBT. The body is " " if there is no request body (typically for GET requests). #Example for Create Deposit Address curl -H "Content-Type:application/json" -H "KC-API-KEY:5c2db93503aa674c74a31734" -H "KC-API-TIMESTAMP:1547015186532" -H "KC-API-PASSPHRASE:Abc123456" -H "KC-API-SIGN:7QP/oM0ykidMdrfNEUmng8eZjg/ZvPafjIqmxiVfYu4=" -X POST -d '{"currency":"BTC"}' http://openapi-v2.kucoin.com/api/v1/deposit-addresses KC-API-KEY = 5c2db93503aa674c74a31734 KC-API-SECRET = f03a5284-5c39-4aaa-9b20-dea10bdcf8e3 KC-API-PASSPHRASE = Abc123456 TIMESTAMP = 1547015186532 METHOD = POST ENDPOINT = /api/v1/deposit-addresses STRING-TO-SIGN = 1547015186532POST/api/v1/deposit-addresses{"currency":"BTC"} KC-API-SIGN = 7QP/oM0ykidMdrfNEUmng8eZjg/ZvPafjIqmxiVfYu4=
FAQ Invalid Sign Check if your API-KEY, API-SECRET and API-PASSPHRASE are correct Check the content String: timestamp + method + requestEndpoint + body Check whether the timestamp in header is the same with the content above Check whether you are using the correct encoding in your signature, e.g. base64 Check Whether the get request is submitted as a form Check whether the content-type of POST request is application/json and charset=utf-8 Apply Withdraw
Learn More