2

I have an issue with API requests from tzscan. When calling delegator_rewards in my PHP script, for instance:

https://api6.tzscan.io/v3/delegator_rewards/KT1ALgpzePTQPsmbtybBhC3Kg6RNK8gTXUQi

then outputs often do not show up. I've tested with several delegator-addresses in a browser and often only after several reloads the API call shows results. This behaviour makes it difficult to use delegator_rewards in a PHP script.

For reference, I performed a simple test and counted the time I needed to reload the browser with the above quoted URL until I got a response: I had to reload the page 7 times until I got a response. 6 times I immediately received a blank screen and the 7th time the outputs were loaded with the response time being around 2 seconds.

How should this API be called in a PHP script to be more responsive?

6
  • Would be useful if you could perform some measurements and provide the statistics to quantify your question more
    – Ezy
    Apr 15 '19 at 11:54
  • Sorry, I don’t understand your comment. How can I perform such measurements?
    – cryptodad
    Apr 15 '19 at 11:57
  • you want to record the time your browser emitted the request and the time you got your response. You could compare this to the ping response time to assess tzscan internal latency ?
    – Ezy
    Apr 15 '19 at 11:59
  • 1
    Ok, will try that and then improve the question.
    – cryptodad
    Apr 15 '19 at 12:00
  • Tzscan does not seem to respond to ping requests: "ping: cannot resolve tzscan.io: Unknown host". I improved the answer with your first suggestion though.
    – cryptodad
    Apr 15 '19 at 13:19

Browse other questions tagged or ask your own question.