Coverage History for ALL Commits in a Specific Branch with API

Description

I am trying to retrieve all coverage history from a specific branch. issue issue-2302 did something similar but it has a page number and limit.

Is it possible to have something like https://codecov.io/api/gh/<org-name>/<repo-name>/branch/master/commits?page=<ALL-PAGES>

i.e I want ALL coverage FOR ALL COMMITS for my master branch

As stated previously, issue issue-2302 does get the response I want but the problem is the commits coverage results are limited by the page number and the limit fields. I want coverage for all commits in my specific branch.

Second question: is it possible to know the total number of the page field before hand? I was thinking I could iterate through it to get all the commits if there is no solution to get all commits coverage all at once.

Hi @ErnestFistozz, unfortunately, it is not possible to get a single API call to get all of your commits in one response. You will need to iterate over each page.

As for knowing the number of pages, there is no current way to do that, but it is a really good idea. I’ll make sure the product team knows about it.

1 Like

Hi @tom ,
Thanks. much appreciated.

1 Like