© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
8 replies
stigzler

❔ Optimising multi-threaded web API calls

Hi all. I am looking to code a wrapper to access a web API (Screenscraper.fr). The API provides both metadata for games and also images via download urls.

My question is about how best to approach this. Al I know about he web API is that it provides users with a variable number of "threads." I have no idea how this works from the Web API application side. Sadly, that means I don't know what counts as a "thread" from the application's point of view. The app is great, the documentation and support less so!

I will need to be downloading text (the metadata - in either xml or json) and the images.

Should I use a
Parallel ForEach
Parallel ForEach
loop, or will this not count as "threads" on the API?

Also, I'm going o finally try and get to grips with
HttpClient
HttpClient
- I understand you should only initiate one
HttpClient
HttpClient
and keep it 'live'? If so, I would presumably need to spawn a number of
HttpClients
HttpClients
totalling the users number of threads. How would I weave this in code?

Hope make sense. Sorry, I'm not a professional developer, just a hobbyist!
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

multi threaded gate lock OR
C#CC# / help
2y ago
Is ASP.NET Core requests handling multi-threaded?
C#CC# / help
3y ago
Web api
C#CC# / help
12mo ago
Optimising SkiaSharp blit/copy
C#CC# / help
3y ago