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
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}'import osimport requestsresponse = requests.post( "https://api.bridgly.app/github/search-commits", headers={"Authorization": f"Bearer {os.environ['BRIDGLY_KEY']}"}, json={ "query": "fix memory leak", "sort": "committer-date", "count": 10, },)data = response.json()const response = await fetch("https://api.bridgly.app/github/search-commits", { method: "POST", headers: { Authorization: `Bearer ${process.env.BRIDGLY_KEY}`, "Content-Type": "application/json", }, body: JSON.stringify({ "query": "fix memory leak", "sort": "committer-date", "count": 10 }),});const data = await response.json();import { Bridgly } from "@bridgly/sdk";const client = new Bridgly({ apiKey: "bgly_YOUR_KEY" });const res = await client.github.searchCommits({ query: "fix memory leak", sort: "committer-date", count: 10});if (res.type === "success") { console.log(res.data);}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
{ "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 }}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.
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.
More GitHub endpoints
The same API key works on every endpoint. See all GitHub API endpoints.
- GitHub Issue Search API→GitHub issues API: search issues by keyword, repo, state, labels, author, assignee, comment count and dates, with title, state, labels and timestamps.
- GitHub Pull Request Search API→GitHub pull request search API: search PRs by keyword, repo, state, author, labels, review status, draft and merge date, with labels and merge status.
- GitHub Discussion Search API→GitHub discussions API: search GitHub Discussions by keyword, repo, author, comment count, dates and answered status, with category and comment count.
- GitHub User Search API→Find GitHub developers and organizations by location, language, followers and join date. Get bios and repository counts with the GitHub User Search API.
Try the GitHub Commit Search API
100 free credits on business email, no card. Your first call takes a minute.