Get Single Commit
Retrieve a single commit by its SHA or git reference.Path Parameters
Owner of the repository
Name of the repository
A git reference or commit SHA
Query Parameters
Include diff stats for the commit (disable for speedup)
Include verification information for the commit (disable for speedup)
Include list of affected files (disable for speedup)
Response
Commit SHA hash
API URL for the commit
Web URL to view the commit
Commit information
Committer information (same structure as author)
Commit message
Array of parent commit metadata
List All Commits
Get a list of all commits from a repository.Path Parameters
Owner of the repository
Name of the repository
Query Parameters
SHA or branch to start listing commits from (usually ‘master’ or ‘main’)
Filepath of a file/directory to filter commits
Only commits after this date (ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ)
Only commits before this date (ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ)
Include diff stats for every commit
Include verification for every commit
Include list of affected files for every commit
Commits that match the given specifier will not be listed
Page number of results (1-based)
Page size of results (ignored if used with ‘path’)
Response
Returns an array of commit objects (same structure as Get Single Commit).The response includes pagination headers:
X-Total-Count: Total number of commitsX-Page: Current page numberX-PerPage: Number of items per pageX-PageCount: Total number of pagesX-HasMore: Whether more pages exist
Download Commit Diff or Patch
Get a commit’s diff or patch file.Path Parameters
Owner of the repository
Name of the repository
SHA of the commit to get
Output format:
diff or patchResponse
Returns plain text diff or patch content.Get Commit Pull Request
Retrieve the pull request that merged this commit.Path Parameters
Owner of the repository
Name of the repository
SHA of the commit
Response
Returns a pull request object if the commit was part of a merged pull request.Pull request ID
Pull request number
Pull request title
Pull request state:
open, closed, mergedWhether the pull request was merged
Timestamp when merged (ISO 8601)
SHA of the merge commit
Common Use Cases
List Recent Commits
Get the most recent commits from the default branch:Get Commits by Author
While the API doesn’t have a direct author filter, you can filter commits after fetching them or use thesince parameter combined with knowing when the author was active.