Quant coder

Quant coder · GPT Actions

GitHub Repository Search and Details

  • GET /search/repositoriesSearch for repositories with minimal data
  • GET /repos/{owner}/{repo}/contents/Get the contents of a repository's root directory
  • GET /repos/{owner}/{repo}/contents/{path}Get the contents of a repository's documentation directory
原始 API 定义
{
  "openapi": "3.0.0",
  "info": {
    "title": "GitHub Repository Search and Details",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.github.com"
    }
  ],
  "paths": {
    "/search/repositories": {
      "get": {
        "operationId": "searchRepositories",
        "summary": "Search for repositories with minimal data",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "stars",
                "forks",
                "updated"
              ],
              "default": "stars"
            }
          },
          {
            "name": "order",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "asc",
                "desc"
              ],
              "default": "desc"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 10,
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A list of repositories matching the search query with only stars and update time",
            "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"
                          },
                          "stargazers_count": {
                            "type": "integer"
                          },
                          "updated_at": {
                            "type": "string"
                          },
                          "html_url": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/repos/{owner}/{repo}/contents/": {
      "get": {
        "operationId": "getRepositoryContents",
        "summary": "Get the contents of a repository's root directory",
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "repo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The contents of the repository",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "path": {
                        "type": "string"
                      },
                      "size": {
                        "type": "integer"
                      },
                      "url": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/repos/{owner}/{repo}/contents/{path}": {
      "get": {
        "operationId": "getDocumentation",
        "summary": "Get the contents of a repository's documentation directory",
        "parameters": [
          {
            "name": "owner",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "repo",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "path",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "default": "docs"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The contents of the documentation directory",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "path": {
                        "type": "string"
                      },
                      "size": {
                        "type": "integer"
                      },
                      "content": {
                        "type": "string"
                      },
                      "encoding": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}