GitHub: Search topics
GitHub search.searchTopics: arguments, response, policy and SDK examples.
← Search operations · Get started
Operation github.search_topics
Provider route: GET /search/topics. Alter supplies the connection’s credentials and routing.
Call through Alter
Section titled “Call through Alter”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"]["searchTopics"]>[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.searchTopics(input); const result = await call.wait(); return result.bodyJson(); } finally { await app.close(); }}import osfrom alter_sdk import Appfrom 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_topics(arguments) result = await call.wait() return result.body_json()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
query | object | Required within parent | Additional keys: not allowed |
query.q | string | Required within parent | |
query.per_page | integer | Optional | Default: 30 |
query.page | integer | Optional | Default: 1 |
Response
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
incomplete_results | boolean | Required within parent | |
items | array | Required within parent | |
items[] | Model | Each item | Expand Search topics — response body — items item |
total_count | JSON | Required within parent | |
total_count (anyOf 1) | integer | Alternative | |
total_count (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
Referenced models: Search topics — response body — items item
Schemas
Section titled “Schemas”Search topics — response body — items item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Topic Search Result Item |
aliases | JSON | Optional | |
aliases (anyOf 1) | array | Alternative | |
aliases (anyOf 1)[] | object | Each item | |
aliases (anyOf 1)[].topic_relation | object | Optional | |
aliases (anyOf 1)[].topic_relation.id | JSON | Optional | |
aliases (anyOf 1)[].topic_relation.id (anyOf 1) | integer | Alternative | |
aliases (anyOf 1)[].topic_relation.id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
aliases (anyOf 1)[].topic_relation.name | string | Optional | |
aliases (anyOf 1)[].topic_relation.relation_type | string | Optional | |
aliases (anyOf 1)[].topic_relation.topic_id | JSON | Optional | |
aliases (anyOf 1)[].topic_relation.topic_id (anyOf 1) | integer | Alternative | |
aliases (anyOf 1)[].topic_relation.topic_id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
aliases (anyOf 2) | null | Alternative | |
created_at | string | Required within parent | Format: date-time |
created_by | JSON | Required within parent | |
created_by (anyOf 1) | string | Alternative | |
created_by (anyOf 2) | null | Alternative | |
curated | boolean | Required within parent | |
description | JSON | Required within parent | |
description (anyOf 1) | string | Alternative | |
description (anyOf 2) | null | Alternative | |
display_name | JSON | Required within parent | |
display_name (anyOf 1) | string | Alternative | |
display_name (anyOf 2) | null | Alternative | |
featured | boolean | Required within parent | |
logo_url | JSON | Optional | |
logo_url (anyOf 1) | string | Alternative | Format: uri |
logo_url (anyOf 2) | null | Alternative | |
name | string | Required within parent | |
related | JSON | Optional | |
related (anyOf 1) | array | Alternative | |
related (anyOf 1)[] | object | Each item | |
related (anyOf 1)[].topic_relation | object | Optional | |
related (anyOf 1)[].topic_relation.id | JSON | Optional | |
related (anyOf 1)[].topic_relation.id (anyOf 1) | integer | Alternative | |
related (anyOf 1)[].topic_relation.id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
related (anyOf 1)[].topic_relation.name | string | Optional | |
related (anyOf 1)[].topic_relation.relation_type | string | Optional | |
related (anyOf 1)[].topic_relation.topic_id | JSON | Optional | |
related (anyOf 1)[].topic_relation.topic_id (anyOf 1) | integer | Alternative | |
related (anyOf 1)[].topic_relation.topic_id (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
related (anyOf 2) | null | Alternative | |
released | JSON | Required within parent | |
released (anyOf 1) | string | Alternative | |
released (anyOf 2) | null | Alternative | |
repository_count | JSON | Optional | |
repository_count (anyOf 1) | JSON | Alternative | |
repository_count (anyOf 1) (anyOf 1) | integer | Alternative | |
repository_count (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
repository_count (anyOf 2) | null | Alternative | |
score | JSON | Required within parent | |
score (anyOf 1) | number | Alternative | |
score (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
short_description | JSON | Required within parent | |
short_description (anyOf 1) | string | Alternative | |
short_description (anyOf 2) | null | Alternative | |
text_matches | Model | Optional | Expand Search code — response body — items item text matches |
updated_at | string | Required within parent | Format: date-time |
Referenced models: Search code — response body — items item text matches
Search code — response body — items item text matches
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | array | Root | |
$[] | object | Each item | |
$[].fragment | string | Optional | |
$[].matches | array | Optional | |
$[].matches[] | object | Each item | |
$[].matches[].indices | array | Optional | |
$[].matches[].indices[] | JSON | Each item | |
$[].matches[].indices[] (anyOf 1) | integer | Alternative | |
$[].matches[].indices[] (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
$[].matches[].text | string | Optional | |
$[].object_type | JSON | Optional | |
$[].object_type (anyOf 1) | string | Alternative | |
$[].object_type (anyOf 2) | null | Alternative | |
$[].object_url | string | Optional | |
$[].property | string | Optional |
Policy, approvals and errors
Section titled “Policy, approvals and errors”SDK function policy ID: github.search_topics. Catalog operation: search/topics. 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"}