0

I've looked into threading and running code parallel but I cannot find anything that solves my question. I'm currently trying to attempt to request all these API at the same time, not one after each other and then wait for all the responses to return and continue with my code. Can anyone point me towards how I would achieve this?

endpoints = [
    "https://catalog.roblox.com/v1/search/items/details?Category=2&limit=30",
    "https://catalog.roblox.com/v1/search/items/details?Category=2&limit=30&cursor=2_1_2167f7d4b3197b431e755ba9c8768abc",
    "https://catalog.roblox.com/v1/search/items/details?Category=2&limit=30&cursor=3_1_199718dc634c5ddba06fb0c047353b03",
    "https://catalog.roblox.com/v1/search/items/details?Category=2&limit=30&cursor=4_1_5d23baeb27732b19291627adb4e71e1d"
]

Thanks.

gianni
  • 113
  • 1
  • 11
  • Does this answer your question? [Making multiple API calls in parallel using Python (IPython)](https://stackoverflow.com/questions/16982569/making-multiple-api-calls-in-parallel-using-python-ipython) – Shubham Periwal Jun 26 '21 at 08:28
  • I've already tried using this solution but the threads still just wait for the last to end. – gianni Jun 26 '21 at 08:29
  • Look here: https://www.machinelearningplus.com/python/parallel-processing-python/ – Aiyush Jun 26 '21 at 08:34
  • @gianni: You should post the code you tried and point out exactly why it doesn't work as you want. – quamrana Jun 26 '21 at 08:44
  • have you tried grequests: https://pypi.org/project/grequests/ – T. Kelher Jun 26 '21 at 08:45

0 Answers0