The Travis documentation is not clear if we can navigate through the builds. The endpoint:
https://api.travis-ci.org/repos/caelum/vraptor4/builds
Shows the last 50 builds.
But how to get the whole history?
Builds are paginated, so you need to fetch with multiple requests.
The endpoint supports the after_number
parameter, which is the build number (field number
) from the last build in the previously fetched page.
So if your first result set's last build entry has the build number 2669 (which is the current last build number on the page from https://api.travis-ci.org/repos/caelum/vraptor4/builds), you'd fetch subsequent builds with this URL:
https://api.travis-ci.org/repos/caelum/vraptor4/builds?after_number=2669
That way you iterate through the builds rather than fetch thousands of them at once.