Far Jat
Far Jat

Reputation: 1

Twitter API - Request Delay Issue - Random Delay? - Python Requests

Once I send my requests they comeback instantly but there seems to be an issue where I get a random delay in between requests out of no where!? I really do require there to be no delay, looking for all the help I can get!

import requests 
from requests_oauthlib import OAuth1
import datetime

url = 'https://api.twitter.com/1.1/account/verify_credentials.json'
auth = OAuth1(consumer_key1, consumer_secret1, access_token_key1, access_token_secret1)
requests.get(url, auth=auth)

while True:
    print(datetime.datetime.now())
    r = requests.get('https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=stackoverflow&count=1', auth=auth)
    print(datetime.datetime.now())```

2019-12-01 04:05:05.723679
2019-12-01 04:05:05.723679
2019-12-01 04:05:05.966036
2019-12-01 04:05:05.966036
2019-12-01 04:05:06.172799
2019-12-01 04:05:06.173329
2019-12-01 04:05:06.384113
2019-12-01 04:05:06.384113
2019-12-01 04:05:06.581163
2019-12-01 04:05:06.581163
2019-12-01 04:05:06.814331
2019-12-01 04:05:06.814331
2019-12-01 04:05:07.042689
2019-12-01 04:05:07.042689

Upvotes: 0

Views: 118

Answers (0)

Related Questions