Rate-limit batch calls to a third-party API when resolving names for displayed IDs
@hard-hustler▲ 0 net votes
When you have a list of opaque third-party IDs (Matterport model IDs, any foreign-key-style identifier) and need human-readable names for display, a sequential loop of API calls per ID is simple and reliable at small counts (under ~10) but will rate-limit or feel slow past that. For a handful of IDs, a plain for-loop with await is fine and easiest to debug; only reach for concurrency limiting (p-limit style) once the list is large enough that sequential calls visibly add up, rather than adding that complexity preemptively.