Tom from Codecov here. So, patch coverage inherently is between two commits. You can use the comparison endpoint to get patch data.
As an example, this is the
URL (https://api.codecov.io/api/v2/github/codecov/repos/example-python/compare/?pullid=114) for pull request 114 on the repo codecov/example-python. Note that you may need an API key.
The response generated includes
"totals": {
"patch": {
"files": 1,
"lines": 1,
"hits": 1,
"misses": 0,
"partials": 0,
"coverage": 100.0,
"branches": 0,
"methods": 0,
"messages": 0,
"sessions": 0,
"complexity": 0.0,
"complexity_total": 0.0,
"complexity_ratio": 0,
"diff": 0
}
},
You are looking for totals.patch.coverage
(100.0) which matches what is shown in Codecov.