GitLab API for /commits - how to obtain multiple commits via one call (batch)

Gitlab commits API suggests a couple of endpoints to obtain details of commits:

  • GET /projects/:id/repository/commits/:sha
  • GET /projects/:id/repository/commits/:sha/diff

I’m wondering if it’s possible (and how?) to wrap multiple commits in one call? For example, to retrieve by 50 or even 100 commits per each call. The purpose is to reduce the amount of API calls from my application to gitlab.

Alternatively, is there a way to manage the throttling to increase a higher throughput of API calls for some specific users or ips? but keep it low for others to protect from ddos


A proposal with the fix: