Skip to content

GitHub: Search repositories

GitHub search.searchRepos: arguments, response, policy and SDK examples.

← Search operations · Get started

Operation github.search_repos

Provider route: GET /search/repositories. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/github with npm, or alter-sdk-github with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { GitHubIntegration } from "@alter-ai/github";
async function execute(input: Parameters<GitHubIntegration["search"]["searchRepos"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new GitHubIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.search.searchRepos(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_github import GitHubIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = GitHubIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.search.search_repos(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
queryobjectRequired within parentAdditional keys: not allowed
query.qstringRequired within parent
query.sortstringOptionalOne of: stars, forks, help-wanted-issues, updated
query.orderstringOptionalDefault: desc
One of: desc, asc
query.per_pageintegerOptionalDefault: 30
query.pageintegerOptionalDefault: 1

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$objectRoot
incomplete_resultsbooleanRequired within parent
itemsarrayRequired within parent
items[]ModelEach itemExpand Search repositories — response body — items item
total_countJSONRequired within parent
total_count (anyOf 1)integerAlternative
total_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$

Referenced models: Search repositories — response body — items item

3 more schemas are linked from the tables above, on the schema pages.

Search repositories — response body — items item
FieldTypePresenceDescription and constraints
$objectRootRepo Search Result Item
allow_auto_mergebooleanOptional
allow_forkingbooleanOptional
allow_merge_commitbooleanOptional
allow_rebase_mergebooleanOptional
allow_squash_mergebooleanOptional
archive_urlstringRequired within parent
archivedbooleanRequired within parent
assignees_urlstringRequired within parent
blobs_urlstringRequired within parent
branches_urlstringRequired within parent
clone_urlstringRequired within parent
collaborators_urlstringRequired within parent
comments_urlstringRequired within parent
commits_urlstringRequired within parent
compare_urlstringRequired within parent
contents_urlstringRequired within parent
contributors_urlstringRequired within parentFormat: uri
created_atstringRequired within parentFormat: date-time
default_branchstringRequired within parent
delete_branch_on_mergebooleanOptional
deployments_urlstringRequired within parentFormat: uri
descriptionJSONRequired within parent
description (anyOf 1)stringAlternative
description (anyOf 2)nullAlternative
disabledbooleanRequired within parentReturns whether or not this repository disabled.
downloads_urlstringRequired within parentFormat: uri
events_urlstringRequired within parentFormat: uri
forkbooleanRequired within parent
forksJSONRequired within parent
forks (anyOf 1)integerAlternative
forks (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
forks_countJSONRequired within parent
forks_count (anyOf 1)integerAlternative
forks_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
forks_urlstringRequired within parentFormat: uri
full_namestringRequired within parent
git_commits_urlstringRequired within parent
git_refs_urlstringRequired within parent
git_tags_urlstringRequired within parent
git_urlstringRequired within parent
has_discussionsbooleanOptional
has_downloadsbooleanRequired within parent
has_issuesbooleanRequired within parent
has_pagesbooleanRequired within parent
has_projectsbooleanRequired within parent
has_pull_requestsbooleanOptional
has_wikibooleanRequired within parent
homepageJSONRequired within parent
homepage (anyOf 1)stringAlternativeFormat: uri
homepage (anyOf 2)nullAlternative
hooks_urlstringRequired within parentFormat: uri
html_urlstringRequired within parentFormat: uri
idJSONRequired within parent
id (anyOf 1)integerAlternative
id (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
is_templatebooleanOptional
issue_comment_urlstringRequired within parent
issue_events_urlstringRequired within parent
issues_urlstringRequired within parent
keys_urlstringRequired within parent
labels_urlstringRequired within parent
languageJSONRequired within parent
language (anyOf 1)stringAlternative
language (anyOf 2)nullAlternative
languages_urlstringRequired within parentFormat: uri
licenseModelRequired within parentExpand Create a fork — response body — license
master_branchstringOptional
merges_urlstringRequired within parentFormat: uri
milestones_urlstringRequired within parent
mirror_urlJSONRequired within parent
mirror_url (anyOf 1)stringAlternativeFormat: uri
mirror_url (anyOf 2)nullAlternative
namestringRequired within parent
node_idstringRequired within parent
notifications_urlstringRequired within parent
open_issuesJSONRequired within parent
open_issues (anyOf 1)integerAlternative
open_issues (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
open_issues_countJSONRequired within parent
open_issues_count (anyOf 1)integerAlternative
open_issues_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
ownerModelRequired within parentExpand Get an issue — response body — user
permissionsobjectOptional
permissions.adminbooleanRequired within parent
permissions.maintainbooleanOptional
permissions.pullbooleanRequired within parent
permissions.pushbooleanRequired within parent
permissions.triagebooleanOptional
privatebooleanRequired within parent
pull_request_creation_policystringOptionalThe policy controlling who can create pull requests: all or collaborators_only.
Known values: all, collaborators_only
pulls_urlstringRequired within parent
pushed_atstringRequired within parentFormat: date-time
releases_urlstringRequired within parent
scoreJSONRequired within parent
score (anyOf 1)numberAlternative
score (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
sizeJSONRequired within parent
size (anyOf 1)integerAlternative
size (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
ssh_urlstringRequired within parent
stargazers_countJSONRequired within parent
stargazers_count (anyOf 1)integerAlternative
stargazers_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
stargazers_urlstringRequired within parentFormat: uri
statuses_urlstringRequired within parent
subscribers_urlstringRequired within parentFormat: uri
subscription_urlstringRequired within parentFormat: uri
svn_urlstringRequired within parentFormat: uri
tags_urlstringRequired within parentFormat: uri
teams_urlstringRequired within parentFormat: uri
temp_clone_tokenstringOptionalWhen present and non-empty, a temporary credential for read-only Git access to this repository.
It expires five minutes after generation and cannot be used to push changes.
Treat this value as sensitive and avoid recording it in logs.
text_matchesModelOptionalExpand Search code — response body — items item text matches
topicsarrayOptional
topics[]stringEach item
trees_urlstringRequired within parent
updated_atstringRequired within parentFormat: date-time
urlstringRequired within parentFormat: uri
visibilitystringOptionalThe repository visibility: public, private, or internal.
watchersJSONRequired within parent
watchers (anyOf 1)integerAlternative
watchers (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
watchers_countJSONRequired within parent
watchers_count (anyOf 1)integerAlternative
watchers_count (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
web_commit_signoff_requiredbooleanOptional

Referenced models: Create a fork — response body — license, Get an issue — response body — user, Search code — response body — items item text matches

Get an issue — response body — user
FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)ModelAlternativeExpand Get an issue — response body — user A Git Hub user
$ (anyOf 2)nullAlternative

Referenced models: Get an issue — response body — user A Git Hub user

SDK function policy ID: github.search_repos. Catalog operation: search/repos. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Pinned headers: {"X-GitHub-Api-Version": "2026-03-10", "User-Agent": "Alter", "Accept": "application/vnd.github+json"}

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.