Get Single Commit
Retrieve a single commit by its SHA or git reference.Path Parameters
string
required
Owner of the repository
string
required
Name of the repository
string
required
A git reference or commit SHA
Query Parameters
boolean
default:"true"
Include diff stats for the commit (disable for speedup)
boolean
default:"true"
Include verification information for the commit (disable for speedup)
boolean
default:"true"
Include list of affected files (disable for speedup)
Response
string
Commit SHA hash
string
API URL for the commit
string
Web URL to view the commit
object
Commit information
object
Committer information (same structure as author)
string
Commit message
array
Array of parent commit metadata
array
List All Commits
Get a list of all commits from a repository.Path Parameters
string
required
Owner of the repository
string
required
Name of the repository
Query Parameters
string
SHA or branch to start listing commits from (usually ‘master’ or ‘main’)
string
Filepath of a file/directory to filter commits
string
Only commits after this date (ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ)
string
Only commits before this date (ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ)
boolean
default:"true"
Include diff stats for every commit
boolean
default:"true"
Include verification for every commit
boolean
default:"true"
Include list of affected files for every commit
string
Commits that match the given specifier will not be listed
integer
default:"1"
Page number of results (1-based)
integer
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
string
required
Owner of the repository
string
required
Name of the repository
string
required
SHA of the commit to get
string
required
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
string
required
Owner of the repository
string
required
Name of the repository
string
required
SHA of the commit
Response
Returns a pull request object if the commit was part of a merged pull request.integer
Pull request ID
integer
Pull request number
string
Pull request title
string
Pull request state:
open, closed, mergedboolean
Whether the pull request was merged
string
Timestamp when merged (ISO 8601)
string
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.