bitforexapi / api_doc_en Goto Github PK
View Code? Open in Web Editor NEWBitForex API Document
BitForex API Document
Hi,
The documentation describes that the tickers for the respective symbols can be retrieved individually.
Current API solution:
get symbol list (https://api.bitforex.com/api/v1/market/symbols)
iterate through and call (https://api.bitforex.com/api/v1/market/ticker?symbol=coin-xxx-xxx) for each symbol.
Is there a possibility to get all coins with only one call?
e.g.: https://api.bitforex.com/api/v1/market/ticker?symbol=ALL
Thanks & greetings
Hi!
How I can get historical kline?
Can I add some parameter like 'since' or 'from'?
for example:
solved
Hello, Im trying to make a trading API for Bitforex but I am running into signData invalid problem, I see this thread https://github.com/bitforexapi/API_Doc_en/issues/10 had a similar problem and a poster recommended re-ordering the parameters, I tried alphabetizing and encodingURI like https://github.com/bitforexapi/API_Doc_en/issues/5 thread recommends and still get the same error, does anyone have ideas? Below is my code
const Crypto = require('crypto') // Standard JavaScript cryptography library const request = require('request') // "Request" HTTP req library const config = require('./config') const bitforex =
https://api.bitforex.com`;
const api = "API";
const apiSecretUnencoded = "API_Secret";
let apiSecret = encodeURI(apiSecretUnencoded)
let price = 0;
let amount = 0;
let tradeType = 1; // tradeType 1 is buy , tradeType 2 is sell
let symbol = "coin-usdt-eth";
let nonce = Date.now();
let apiPath = /api/v1/trade/placeOrder?amount=${amount}&accessKey=${api}&nonce=${nonce}&price=${price}&symbol=${symbol}&tradeType=${tradeType}&signData=
const message = ${bitforex}${apiPath}
;
console.log("apiPath: "+ apiPath);
const signData = Crypto.createHmac('sha256', apiSecret).digest('hex');// The authentication signature is hashed using the private key
let fullData = ${bitforex}${apiPath}${signData}
;
console.log("signdata: " + signData);
console.log("");
console.log(${fullData}
);
const body = {}
const options = {
url: fullData,
headers: {
'content-type': 'application/json',
},
json: true
}
request.post(options, (error, response, body) => {
console.log(body); // Logs the response body
})`
access_key = setting_data['access_key']
secret_key = setting_data['secret_key']
method = "POST"
param = {
'accessKey' : access_key,
'amount' : 0.03,
'nonce' : datetime.now().timestamp(),
'price' : 0.01,
'state' : 0,
'symbol': 'coin-usd-btc',
'tradeType' : 1
}
url_query = createURLQuery(Const.BITFOREX_ENDPOINT_PLACE_ORDER_PATH, param)
sign_data = createSignData(secret_key, url_query)
param["signData"] = sign_data
data = json.dumps(param).encode("UTF-8")
order_infos_req = urllib.request.Request(Const.BITFOREX_PLACE_ORDER_URL, data, method=method)
order_infos_res = urllib.request.urlopen(order_infos_req)
def createURLQuery(path, param):
url_query = path + "?"
for key, value in sorted(param.items()):
url_query += key + "=" + str(value) + "&"
return url_query[:-1]
def createSignData(secret_key, content):
print(content)
return hmac.new(secret_key.encode("UTF-8"), content.encode('UTF-8'), hashlib.sha256).hexdigest()
↓placeOrder request's responce
{
"code": "1011",
"success": false,
"time": 1562501191642,
"message": "NeedParam accessKey and signData"
}
↓order_infos_req.data
b'{"accessKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "amount": 0.03, "nonce": 1562501190.60496, "price": 0.01, "state": 0, "symbol": "coin-usd-btc", "tradeType": 1, "signData": "d197ae200e7fea43c895b6a091f3a320b31956869809411ffd470e08c4984bdf"}'
Why is Error1011 returned even though both accessKey and signData are included?
Make API or other opportunity to download archived trading data. This is very necessary for the development of bots and analytics.
Hi there,
I'm a mobile developer, especially iOS application.
I'd like to use the api, but this api requests an access key.
So, how can I get the access key?
Thanks
Hi! Could you provide api for getting info about all unfilled orders like on most other exchanges? It's need to obtain all orders by each pair, without providing 'orderIds' param
Hi,
Is there an API for the perpetual contracts (market data & trading) or when is it planned?
Getting error "SignData: Invalid".
I would like to know if there are any API call limits?
There is an error "1015 | Request too often" so I guess there may be API call limits.
Hi,
I am trying to use the endpoint - https://api.bitforex.com/api/v1/trade/placeOrder
And I do not know what I am doing wrong. I keep getting the following error:
{ code: '1016',
success: false,
time: 1554439494501,
message: 'SignData Invalid' }
But everything looks right, I even double checked my code to ensure the SignData hash is correct based on the example that was given in the API docs.
Anyone got any ideas?
Here's the code:
var crypto = require('crypto')
var axios = require('axios');
var querystring = require('querystring');
var accessKey = 'xxx'
var secretKey = 'secretxxx'
var amount = "1"
var nonce = (new Date).getTime().toString();
var price = "0.00015393"
var symbol = "coin-eth-bf"
var tradeType = "1"
var message = `/api/v1/trade/placeOrder?accessKey=${accessKey}&amount=${amount}&nonce=${nonce}price=${price}&symbol=${symbol}&tradeType=${tradeType}`;
var hash = crypto.createHmac('sha256', secretKey).update(encodeURI(message));
var signData = hash.digest('hex');
var url_a= 'https://api.bitforex.com/api/v1/trade/placeOrder';
const data = {
accessKey: accessKey,
amount: amount,
nonce: nonce,
price: price,
symbol: symbol,
signData: signData,
tradeType:tradeType
};
const options = {
method: 'POST',
headers: { 'content-type': 'application/x-www-form-urlencoded' },
data: encodeURI(querystring.stringify(data)),
url: url_a
};
axios(options).then(function (response) {
console.log(response.data);
})
.catch(function (error) {
console.log(error);
});
I send request to https://api.bitforex.com/api/v1/trade/placeMultiOrder and I receive "message" => "SignData Invalid”.
request example: https://api.bitforex.com/api/v1/trade/placeMultiOrder/api/v1/trade/placeMultiOrder?accessKey=28eb7ae2dbe5ee6c4c64355b98d9e103&nonce=1548761658230&ordersData=%5B%7B1%7D%5D&symbol=coin-usdt-btc&signData=c65fc158ea28c884ceb57abb37319da296ab61abd2e58bed11fa5be2a3c664c1
I think the problem in ordersData param, could you please give me example of work request?
Is there a websocket/streaming API?
https://api.bitforex.com/api/v1/market/trades?symbol=coin-usdt-btc&size=10
tid="0" always. Any idea? Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.