import asyncio
import aiohttp
data = {}
def async_requests(url_lst, params=None):
async def get_html(url, params):
async with aiohttp.ClientSession() as session:
async with session.get(url) as response:
data[params] = await response.json()
loop = asyncio.get_event_loop()
loop.run_until_complete(
asyncio.gather(*(get_html(url_lst[i], params[i]) for i in range(len(url_lst))))
)
return data