> ## Documentation Index
> Fetch the complete documentation index at: https://docs.r28.ai/charter/llms.txt
> Use this file to discover all available pages before exploring further.

# search_commits

> Search commits by message, author or date across GitHub — 'repo:owner/name fix flaky test'. The way to find where a change was introduced. Rate limited to 30 requests per minute.

<div className="tool-route"><span className="tool-row-method" data-method="GET">GET</span><code>{"https://api.github.com/search/commits"}</code></div>

```python github_search_commits.py theme={null}
from charter.packs import github

result = await github.search_commits.ainvoke({"q": ...})
```

<Note>
  Requires `repo`, `read:user`. Pages by number: `page` with `per_page`.
</Note>

## Query parameters

<div className="reference-table">
  | Field                                                     | Type                                                                      | Description                                                                                                                                                                                 |
  | --------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | `perPage`                                                 | `integer`                                                                 | The number of results per page (max 100). Defaults to 30. <span className="field-constraints">≥ 1; ≤ 100; defaults to `30`</span>                                                           |
  | `page`                                                    | `integer`                                                                 | The page number of the results to fetch. Defaults to 1. <span className="field-constraints">≥ 1; defaults to `1`</span>                                                                     |
  | `order`                                                   | [SortDirection](/charter/charter/packs/github/issues/objects#sortdirection)       | Determines whether the first search result returned is the highest number of matches (`desc`) or lowest (`asc`). Ignored unless `sort` is provided. GitHub uses `desc` when this is absent. |
  | `q` <span className="required" title="required">\*</span> | `string`                                                                  | The search query, with commit qualifiers: `repo:owner/name`, `author:LOGIN`, `committer-date:&gt;2026-01-01`, `merge:false`. A bare term searches commit messages.                          |
  | `sort`                                                    | [CommitSearchSort](/charter/charter/packs/github/search/objects#commitsearchsort) | Sorts the results by author or committer date. Absent, results come back by best match.                                                                                                     |
</div>
