Code Sentinel

Code Sentinel · GPT アクション

GitHub API

API for searching code repositories on GitHub based on a query.

  • GET /search/repositoriesSearch for relevant repositories in GitHub

    Search for relevant code repositories based on a query string.

元の API スキーマ
{
  "openapi": "3.0.0",
  "info": {
    "title": "GitHub API",
    "description": "API for searching code repositories on GitHub based on a query.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.github.com",
      "description": "GitHub API server"
    }
  ],
  "paths": {
    "/search/repositories": {
      "get": {
        "operationId": "searchGitHubRepos",
        "summary": "Search for relevant repositories in GitHub",
        "description": "Search for relevant code repositories based on a query string.",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "The search keywords, as well as any qualifiers.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "description": "The sort field. Can be stars, forks, or updated. Default is best match.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "stars",
                "forks",
                "updated"
              ]
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "The sort order if sort parameter is provided. Can be asc or desc. Default is desc.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ]
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "description": "The number of results per page (max 100).",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 30
            }
          },
          {
            "name": "page",
            "in": "query",
            "description": "Page number of the results to fetch.",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of repositories matching the search criteria",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "total_count": {
                      "type": "integer"
                    },
                    "incomplete_results": {
                      "type": "boolean"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "full_name": {
                            "type": "string"
                          },
                          "owner": {
                            "type": "object",
                            "properties": {
                              "login": {
                                "type": "string"
                              },
                              "id": {
                                "type": "integer"
                              },
                              "avatar_url": {
                                "type": "string"
                              },
                              "html_url": {
                                "type": "string"
                              }
                            }
                          },
                          "html_url": {
                            "type": "string"
                          },
                          "description": {
                            "type": "string"
                          },
                          "fork": {
                            "type": "boolean"
                          },
                          "url": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "pushed_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "homepage": {
                            "type": "string"
                          },
                          "size": {
                            "type": "integer"
                          },
                          "stargazers_count": {
                            "type": "integer"
                          },
                          "watchers_count": {
                            "type": "integer"
                          },
                          "language": {
                            "type": "string"
                          },
                          "forks_count": {
                            "type": "integer"
                          },
                          "open_issues_count": {
                            "type": "integer"
                          },
                          "master_branch": {
                            "type": "string"
                          },
                          "default_branch": {
                            "type": "string"
                          },
                          "score": {
                            "type": "number"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Token-based authentication with a personal access token"
      }
    },
    "schemas": {}
  }
}