darwinex / darwin-api-tutorials

Tutorial videos, posts, and source code in Python & R to assist algorithmic traders and DARWIN investors in getting up and running with the DARWIN API.
https://www.youtube.com/watch?v=IDDHyjqt_TY&list=PLv-cA-4O3y96EwRy0T6Y6CY52_x9Zdec9
25 stars 26 forks source link

DarwinQuotesAPI - 1.0. Not Run for me #4

Closed refresko1 closed 4 years ago

refresko1 commented 4 years ago

I am testing "DarwinQuotesAPI - 1.0" and I cannot get the correct answer

curl -X POST -k -H 'Content-Type: application / json' -H 'Authorization: Bearer xxxxxxx-ad2a-3e07-b321-xxxxx' -H 'Accept: application / json' -i 'https: // api .darwinex.com / quotes / 1.0 / quotes '--data' {
   "productNames": [
     "DWZ.4.7", "DWC.4.20"
   ]
} '

I am testing it with this data, but it never returns anything (after 5 minutes) and I must pause the request

What is my mistake? Thank you

gentstats commented 4 years ago

This is the code i get when click "try it out", and works for me: curl -k -X POST "https://api.darwinex.com/quotes/1.0/quotes" -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxx-xxxx-xxxx-xxxx-xxxxx" -d "{ \"productNames\": [ \"DWZ.4.7\" ]}"

refresko1 commented 4 years ago

This is the code i get when click "try it out", and works for me: curl -k -X POST "https://api.darwinex.com/quotes/1.0/quotes" -H "accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer xxxxxxx-xxxx-xxxx-xxxx-xxxxx" -d "{ \"productNames\": [ \"DWZ.4.7\" ]}"

Friend, thanks for answering Are you sure it runs well? I’m just testing it right there, Filling out the header: https://prnt.sc/skhow8 Filling out the product: https://prnt.sc/ski4lc and when I press "execute", it gives the impression that it is loading the information, but it never stops loading and that "loader" and I never get an answer: https://prnt.sc/ski58y

In your case, can you confirm that it returns?

if I press clear (after many minutes, to cancel that infinite "loading"), it presents me with the used curl, and as you can see, it is the same one that you teach me https://prnt.sc/skiic8

What am I doing wrong? i really don't get it Thanks for helping

gentstats commented 4 years ago

Run it from your computer's terminal, must work both in windows and linux if you have curl installed. The quotes api is for streaming, maybe that's the reason for it not working on the doc's page. Likewise that code is just an example, in what programming language are you attempting to implement it?

refresko1 commented 4 years ago

Thanks friend for wanting to help This appears to me (from CMD) Am I doing it so bad? https://prnt.sc/sl74yg

In fact if I try another query, if I get a result https://prnt.sc/sl7it1

gentstats commented 4 years ago

It's better for testing DWC.4.2, it's always open to market and streaming. Be careful with throttling

refresko1 commented 4 years ago

Perfect, thanks, Now it works, Thank you

refresko1 commented 4 years ago

the average response between each "update" is 1100 ms. Can I configure this time, or does it depend directly on the server?

https://prnt.sc/slbapw

thanks

integracore2 commented 4 years ago

Hi @refresko1,

The time between each update depends on several factors such as Quote price delta, and is not configurable by the API user.