元数据

GitHub API Root

Get Hypermedia links to resources accessible in GitHub's REST API

get /

代码示例

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  http(s)://{hostname}/api/v3/
JavaScript (@octokit/core.js)
await octokit.request('GET /')

Response

Status: 200 OK

Notes


get /meta

代码示例

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  http(s)://{hostname}/api/v3/meta
JavaScript (@octokit/core.js)
await octokit.request('GET /meta')

Response

Status: 200 OK
{
  "verifiable_password_authentication": true,
  "packages": [
    "192.30.252.0/22"
  ],
  "dependabot": [
    "54.158.161.132"
  ],
  "installed_version": "2.22.0"
}

Not modified

Status: 304 Not Modified

Notes


Get Octocat

Get the octocat as ASCII art

get /octocat

参数

Name Type In Description
accept string header

Setting to application/vnd.github.v3+json is recommended.

s string query

The words to show in Octocat's speech bubble

代码示例

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  http(s)://{hostname}/api/v3/octocat
JavaScript (@octokit/core.js)
await octokit.request('GET /octocat')

Response

Status: 200 OK

Notes


Get the Zen of GitHub

Get a random sentence from the Zen of GitHub

get /zen

代码示例

Shell
curl \
  -H "Accept: application/vnd.github.v3+json" \
  http(s)://{hostname}/api/v3/zen
JavaScript (@octokit/core.js)
await octokit.request('GET /zen')

Response

Status: 200 OK

Notes


此文档对您有帮助吗?隐私政策

帮助我们创建出色的文档!

所有 GitHub 文档都是开源的。看到错误或不清楚的内容了吗?提交拉取请求。

做出贡献

或, 了解如何参与。