I need to get some json data using API
import requests
url = 'https://example.com/api/some-info/'
response = requests.get(url)
print(response.text) # Here is JSON needeed
And everything fine, except I need to make such requests very often, and API provider says:
You'll be banned if you make more than 5 requests per second, so use sockets
So, how can I make this work via sockets? Big thx for advices.
asked Jan 2, 2017 at 19:33
MaxCore
2,8156 gold badges31 silver badges49 bronze badges
-
websockets.readthedocs.io/en/stablekitti– kitti2017年01月02日 19:40:23 +00:00Commented Jan 2, 2017 at 19:40
-
@RahulKP, We should make maximum requests as possible requests=) It is very for business) And, yes it is an option, but I am also interested in how can sockets can help with DDoS protection)MaxCore– MaxCore2017年01月02日 19:41:07 +00:00Commented Jan 2, 2017 at 19:41
-
stackoverflow.com/questions/14140914/…Rahul K P– Rahul K P2017年01月02日 19:41:41 +00:00Commented Jan 2, 2017 at 19:41
lang-py