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.

3
  • websockets.readthedocs.io/en/stable Commented 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) Commented Jan 2, 2017 at 19:41
  • stackoverflow.com/questions/14140914/… Commented Jan 2, 2017 at 19:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.