Python: get json data from https url using sockets

407 views Asked by At

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.

0

There are 0 answers