使用Google脚本的Binance API [英] Binance API with Google Script
问题描述
我试图从Binance(使用签名端点安全)将我的交易历史记录拖放到Google表单中,以便我可以使用Google脚本记录所有交易记录。我被困在无法使用api键拉取数据的地方。下面的snippit是我可以从Binance API和UrlFetchApp API中得到的。
$ b
var data = UrlFetchApp.fetch( https://api.binance.com/api/v3/myTrades , {header:apiKey})
我也发现这篇文章。
你可以'在网址栏中添加标题。
编辑我看到您使用的是UrlFetchApp。在这种情况下,正确的语法是:
var headers = {'X-MBX-APIKEY':apiKey}
UrlFetchApp.fetch(https://api.binance.com/api/v3/myTrades,{'headers':headers})
I am attempting to pull my trade history from Binance (using signed endpoint security) into google sheets so that I can keep records of all my trades using google scripts. I am stuck where I can't pull the data using the api keys. The below snippit is as far as I could get from my understaning of the Binance API and UrlFetchApp API.
var data = UrlFetchApp.fetch("https://api.binance.com/api/v3/myTrades", {headers : apiKey})
I also have found this post.
You can't add the header in the url bar.
EDIT I see you are using UrlFetchApp. In that case, the correct syntax is
var headers = {'X-MBX-APIKEY': apiKey}
UrlFetchApp.fetch("https://api.binance.com/api/v3/myTrades", {'headers': headers})
这篇关于使用Google脚本的Binance API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!