Github API: how to view open commits on a specific branch?

I am looking for functionality in the github api, to see if there are still open commits on specific branch.

With open commits, I mean all commits that aren’t yet merged with the default branch.

I tried to use the “list branches” api (, but this doesn’t return any information on commits.

Note: I posted the same question on stackoverflow:

Hi @cremersstijn,

Thanks for being part of the GitHub Community Forum! We’re glad you’re here.
For this specific topic, I suggest checking out our Platform Community, they specialize in API questions.


my apologies! I did not mean to reply to this post