Api compare repository branch

Hello,

I would like to know is there is any way to retrieve this type of request :
https/gitlab.com/api/v4/projects/:id/repository/compare/?from=commitsource&to=commitForked?from_project_id=idProjectFrom

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 :

https://gitlab.com/api/v4/projects/16498359/repository/compare/?from=sourceCommitId&to=forkedCommitId