Closed TuringZhu closed 3 years ago
Please provide some snippet of your not-working-as-expected code
sometimes it return expected data, but sometimes it not.
package main
import (
"fmt"
"github.com/antihax/optional"
"github.com/gateio/gateapi"
)
var (
err error
client *gateapi.APIClient
)
func main() {
client = gateapi.NewAPIClient(gateapi.NewConfiguration())
client.SetKeySecret("MY_KEY", "MY_SECRET")
client.ChangeBasePath("MY_PROXY")
api := client.SpotApi
trades,_,err:= api.ListMyTrades(nil, "BTC_USDT", &gateapi.ListMyTradesOpts{
Page:optional.NewInt32(1),
Limit:optional.NewInt32(5),
})
if err != nil {
fmt.Println(err)
}
for _, v:= range trades {
fmt.Println(v)
}
}
for gateio only allowing ip access sensitive information with specified ip in whitelist, I configured proxy with nginx:
server {
listen 80;
server_name MY_DOMAINNAME;
access_log logs/gateio-access.log main;
error_log logs/gateio-error.log;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header Host api.gateio.ws;
proxy_pass https://api.gateio.ws:443/;
}
}
Change the error output like this:
if err != nil {
if e, ok := err.(gateapi.GenericOpenAPIError); ok {
fmt.Println(e.Body())
} else {
fmt.Println(err.Error())
}
} else {
fmt.Println(result)
}
And when it's not returning the expected data. Please provide the response body content
OK
@revilwang
I'm sorry to disturb you, but I have a question and I don't know where to find the answer.
That is, how many times can I call the https://api.gateio.ws/api/v4
per second?
I'm worried that it cannot be called due to a frequency limit error
Spot APIs limit 300 requests/second per IP. Futures private APIs limit 200 requests/second per user.
P.S. request limits will be added into API documentation on next update.
tks👍
I call list my trades api with parameter order and no page and limit,
the api return following data
and http code is 404. status is "404 not found"
but
, when I query with shell with the following code. I can get correct data:the key secret and order_id all correct
can someone tell me why?