0

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.

MaxCore
  • 2,438
  • 4
  • 25
  • 43
  • https://websockets.readthedocs.io/en/stable/ – kitti Jan 02 '17 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 Jan 02 '17 at 19:41
  • http://stackoverflow.com/questions/14140914/how-to-use-socket-fetch-webpage-use-python – Rahul K P Jan 02 '17 at 19:41

0 Answers0