Getting git-rev-list using github API

Hello! I am trying to get the equivalent of git-rev-list from github API. That is, given commits A and B:

git rev-list ^A B

According to git manual, this means:

List commits that are reachable by following the parent links from the given commit(s), but exclude commits that are reachable from the one(s) given with a ^ in front of them. The output is given in reverse chronological order by default.

…which is exactly what I want. Is it possible to get this information from the API, either v3 or v4?