Api compare repository branch


I would like to know is there is any way to retrieve this type of request :

The goal is to retrieve all commits between a repository branch and its forked branch repository.
In the interface we have a limit on 100 commits, but I have a cases with 300+ commits.

I tried to use the API for that, not sure if something exists for that I tried things like :