Search code across public GitHub repositories
github_search_codeSearch code across public GitHub repositories. Read-only: returns public data and changes nothing. Costs 1 credit per request.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fork | Yes | Whether to include forks. Defaults to excluding them. | exclude |
| path | No | Path prefix within the repo, e.g. "src/app". Maps to `path:`. | |
| sort | Yes | Sort field. Defaults to relevance ("best-match"). | best-match |
| count | Yes | Number of results to return (1–10). Defaults to 10. | |
| order | Yes | Sort direction. Defaults to "desc". | desc |
| query | No | Free-text search terms, matched against the default fields for this search type, e.g. "web framework". | |
| repos | No | Limit to these "owner/name" repositories. Maps to `repo:`. | |
| start | No | Number of results to skip (0–999). Defaults to 0. Only the first 1,000 results of a search can be paged through. | |
| owners | No | Limit to these owners (users or orgs). Maps to `user:`. | |
| filename | No | Exact file name, e.g. "package.json". Maps to `filename:`. | |
| language | No | Programming language, e.g. "Go". Maps to `language:`. | |
| extension | No | File extension without the dot, e.g. "ts". Maps to `extension:`. |