Are you sure you want to close the chat?Chat will be closed and the chat history will be cleared.
continue to sign out,
or stay on chat.
To review this chat session please click this windows.
Chat Online
Chat Online0
Support

Forum

A place for Dynadot and community experts alike to ask questions, share ideas, and more.
occasional API bans with python urllib2
5/25/2015 06:32
In the past 2 years I have used the Dynadot API without any problems for drop-catching domains and registering domains.

I never got banned, if i would make only one request at a time. two requests or two scripts running at the same time resulted in an immediate ban. That seemed to be the only thing that the API didn't allow.

In the past months i started using the API again same setup as always and now i find myself getting banned from time to time if i hit the server for a extended period of time.(extended means still less than 1 hour) I sometimes noticed bans after 20 minutes of doing so. Sometimes i don't get banned.


I have not been able to figure out what is going on. The only thing that is different is that I had added a timeout to the urllib2 request.

here is the sample python code: (I hit the API url to make a domain registration request for .com for a domain that is dropping but still exists at the time of the request)

While True:
time.sleep(0.2)
conn = urllib2.urlopen("https://api.dynadot.com/xxxxxxx",  timeout = 7)
response = conn.read()

Note that the sleep time is set to 0.2 seconds in this example. I used to be able to set the sleep time to 0.0 seconds as dynadot would slow down the responses usually. Adding additional sleep time would just slow down things but even with no sleep time a query would usually take more than 1 second.

Any idea what could be causing the bans?
Reply Quote
6/3/2015 03:03
Hello,

Thanks for the reply. No it shouldn't in practice. It checks, then it waits for your server to send the response and then it pauses for 0.2 seconds before making another check.

Usually your server takes 1-2 seconds to process the request and send a response, then it waits 0.2 seconds and then it makes another check.

From my understanding your server will slow the response down depending on the account.

So usually the process should take 1-2 seconds. If i use a different account with zero spending the response time will be 12 seconds or more during the drop.

Your server decides how long the process will take. At least that's how I understood it.

The script will query as fast as your server allows it + a 0.2 second delay added. So far i have never seen it taking less than 1 second so I thought that should be fine. 1-2 seconds is the time an average request takes.

In case there is a connection error the script will pause for 2 seconds. (I have not mentioned this in this example)
Reply Quote
6/2/2015 16:02
To be clear, your script checks every 0.2 seconds (in the instance above)?
Reply Quote