# searchRepositories

**Identifier:** `github_searchRepositories`

**Provider:** [GitHub API](https://kirha.com/providers/github.md)

Query GitHub repositories

## Run it with the CLI

```bash
kirha tools run github_searchRepositories \
  --input '{
    "query": "<query>"
  }'
```

`--input` takes a JSON object that matches the input schema. Pass `--input -` to read it from stdin.

## Call it over HTTP

```bash
curl https://api.kirha.com/tools/v1/execute \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: **********' \
  --data '{
  "tool_name": "github_searchRepositories",
  "input": {
    "query": "<query>"
  }
}'
```

Replace the stars with an API key from https://app.kirha.com/api-keys.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "limit": {
      "default": 10,
      "maximum": 20,
      "minimum": 1,
      "type": "number"
    },
    "query": {
      "description": "GitHub search query. Format: 'keywords qualifier:value'. Common qualifiers: user:USERNAME, org:ORGNAME, language:LANG, stars:>N, fork:true/false, in:name/description/readme. Example: 'machine learning language:python stars:>100 org:openai'",
      "minLength": 1,
      "type": "string"
    },
    "sort": {
      "default": "stars",
      "enum": [
        "stars",
        "forks",
        "updated",
        "help-wanted-issues"
      ],
      "type": "string"
    },
    "trending": {
      "description": "Trending repositories in the last 3 months",
      "type": "boolean"
    }
  },
  "required": [
    "query"
  ],
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "context": {
      "type": "string"
    },
    "incompleteResults": {
      "type": "boolean"
    },
    "repositories": {
      "items": {
        "additionalProperties": false,
        "properties": {
          "createdAt": {
            "type": "string"
          },
          "defaultBranch": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "forksCount": {
            "type": "number"
          },
          "fullName": {
            "type": "string"
          },
          "homepage": {
            "type": [
              "string",
              "null"
            ]
          },
          "id": {
            "type": "number"
          },
          "language": {
            "type": [
              "string",
              "null"
            ]
          },
          "license": {
            "anyOf": [
              {
                "additionalProperties": false,
                "properties": {
                  "key": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  }
                },
                "required": [
                  "key",
                  "name"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "name": {
            "type": "string"
          },
          "openIssuesCount": {
            "type": "number"
          },
          "owner": {
            "additionalProperties": false,
            "properties": {
              "login": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            },
            "required": [
              "login",
              "type"
            ],
            "type": "object"
          },
          "private": {
            "type": "boolean"
          },
          "pushedAt": {
            "type": [
              "string",
              "null"
            ]
          },
          "size": {
            "type": "number"
          },
          "stargazersCount": {
            "type": "number"
          },
          "topics": {
            "anyOf": [
              {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              {
                "type": "null"
              }
            ]
          },
          "updatedAt": {
            "type": "string"
          },
          "visibility": {
            "type": "string"
          },
          "watchersCount": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "name",
          "fullName",
          "owner",
          "private",
          "description",
          "createdAt",
          "updatedAt",
          "pushedAt",
          "homepage",
          "size",
          "stargazersCount",
          "watchersCount",
          "language",
          "forksCount",
          "openIssuesCount",
          "license",
          "defaultBranch",
          "topics",
          "visibility"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "repositoryFullNames": {
      "description": "List of repository full names in the format 'owner/repo'. You can use it to compose with other tools if needed.",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "totalCount": {
      "type": "number"
    }
  },
  "required": [
    "context",
    "totalCount",
    "incompleteResults",
    "repositories",
    "repositoryFullNames"
  ],
  "type": "object"
}
```

## Related tools

Other GitHub API tools that this tool refers to, or that refer to it.

- [`getRepositoryActivity`](https://kirha.com/providers/github/getRepositoryActivity.md)

-----

[All GitHub API tools](https://kirha.com/providers/github.md) · [< Back to tools list](https://kirha.com/tools.md)