GITHUB API

GitHub Commit Search API

Search commits across public GitHub repositories by message, author, committer, date or hash. Each result includes the commit message, SHA, author, committer, link and repository.

Endpoint
POST /github/search-commits
Price
1 credit per request
SDK
client.github.searchCommits()
MCP tool
github_search_commits
Terminal
curl -X POST "https://api.bridgly.app/github/search-commits" \
-H "Authorization: Bearer $BRIDGLY_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "fix memory leak",
"sort": "committer-date",
"count": 10
}'
[ REQUEST AND RESPONSE ]

What does the GitHub Commit Search API return?

GitHub commit search API: search commits across public repositories by message, author, committer, date or SHA, with message, author and repository. Every response has the same envelope: the result in data, plus timeMs and the creditsCost of the call.

Request body

querystring
Free-text search terms, matched against the default fields for this search type, e.g. "web framework".
ownersstring[]
Limit to these owners (users or orgs). Maps to `user:`.
reposstring[]
Limit to these "owner/name" repositories. Maps to `repo:`.
authorstring
Commits authored by this GitHub user. Maps to `author:`.
committerstring
Commits committed by this GitHub user. Maps to `committer:`.
authoredDateobject
Filter by author date. Provide any of gt / gte / lt / lte as YYYY-MM-DD dates; combine a lower and upper bound for a range.
authoredDate.gtstring · nullable
Strictly after this date (YYYY-MM-DD).
authoredDate.gtestring · nullable
On or after this date (YYYY-MM-DD).
authoredDate.ltstring · nullable
Strictly before this date (YYYY-MM-DD).
authoredDate.ltestring · nullable
On or before this date (YYYY-MM-DD).
committedDateobject
Filter by commit date. Provide any of gt / gte / lt / lte as YYYY-MM-DD dates; combine a lower and upper bound for a range.
committedDate.gtstring · nullable
Strictly after this date (YYYY-MM-DD).
committedDate.gtestring · nullable
On or after this date (YYYY-MM-DD).
committedDate.ltstring · nullable
Strictly before this date (YYYY-MM-DD).
committedDate.ltestring · nullable
On or before this date (YYYY-MM-DD).
hashstring
Commits with this SHA (or prefix). Maps to `hash:`.
mergeboolean
Only merge commits (true) or exclude them (false). Maps to `merge:`.
sortenum · default best-match
Sort field. Defaults to relevance ("best-match").
best-match | author-date | committer-date
orderenum · default desc
Sort direction. Defaults to "desc".
desc | asc
countinteger · 1–10 · default 10
Number of results to return (1–10). Defaults to 10.
startinteger · 0–999
Number of results to skip (0–999). Defaults to 0. Only the first 1,000 results of a search can be paged through.

Example response

200 OK · application/json
{
"timeMs": 1840,
"creditsCost": 1,
"data": {
"query": "string",
"totalCount": 0,
"commits": [
{
"sha": "string",
"message": "string",
"url": "string",
"apiUrl": "string",
"author": {
"name": "string",
"email": "string",
"date": "string"
},
"authorLogin": "string",
"committer": {
"name": "string",
"email": "string",
"date": "string"
},
"committerLogin": "string",
"commentCount": 0,
"repository": {
"id": 0,
"nodeId": "string",
"name": "string",
"fullName": "string",
"ownerLogin": "string",
"url": "string",
"isPrivate": true
}
}
],
"nextStart": 0
}
}
[ USE CASES ]

What can you build with the GitHub Commit Search API?

Audit changes

Find every commit that mentions a ticket, CVE or feature.

Measure contributors

Count commits by an author across repositories in a date range.

Trace a fix

Locate the commit that changed a behavior by searching its message.

[ FAQ ]

GitHub Commit Search API questions

How do I search GitHub commits by message?

Send the words as the query, for example fix memory leak, and narrow it with repos, owners, author or a date range. Each commit comes back with its message, SHA, author, committer, link and repository.

Can I find the commits of a specific developer?

Yes. Set author to their GitHub username, and add authoredDate to limit the period. Results can be sorted by author or commit date.

How do I get more than 10 results from a GitHub commit search?

Each call returns up to 10 commits. Send the same query with start set to the nextStart from the response for the next ones. GitHub only lets you page through the first 1,000 results of a search, so narrow the query to reach the rest.

How do I use the GitHub Commit Search API?

Send a POST request to https://api.bridgly.app/github/search-commits with the filters you want in the JSON body and your API key in the Authorization header. In the TypeScript SDK, call client.github.searchCommits(). AI agents connected to Bridgly over MCP can call the github_search_commits tool.

How much does the GitHub Commit Search API cost?

Costs 1 credit per request. Credits cost $2.00 per 1,000 on pay-as-you-go and as low as $1.00 per 1,000 at volume. New accounts on a business email start with 100 free credits, and failed requests are never charged.

Try the GitHub Commit Search API

100 free credits on business email, no card. Your first call takes a minute.

APIMCPSDKCLI
free credits

On business email signup. No credit card required.

Start free with 100 credits