Hi,
I am trying to build a twitter App with python. I am trying to access user data with the API using the URL
TWITTER_URL = 'https://api.twitter.com/1.1/users/show.json'
The rate limit is 180 per 15min. To comply with the rate-limit I built a loop
while True:
if(remaining>0):
## Code for accessing Twitter
headers = connection.info().dict
print 'Remaining', headers['x-rate-limit-remaining']
remaining=int(headers['x-rate-limit-remaining'])
##Code for saving the information
else:
print "waiting for 15min since " + datetime.datetime.now()
time.sleep(900) # delays for 900 seconds = 15min
remaining=10
I can see that my rate-limit is not exceeded because int(headers['x-rate-limit-remaining']) is larger than 1. However my program aborts and my account is suspended even though I have only been downloading very little information. {"errors": [{"message": "User has been suspended.", "code": 63}]}
Is there a reason behind this?
Best