Topics


Pages


Content

Overview

GitHub hosts code for developers and organizations and makes the code and history available through APIs. Here are GitHub’s two latest ones:

  • V3 REST API
  • V4 GraphQL

You can use curl or a library like Python requests to do command-line requests to the API.

For easy debugging, autocompletion and exploring of the schema, use the GraphQL explorer.

REST API

  • Version: 3
  • API URL: api.github.com/
    • Do GET requests against the many endpoints here.
    • e.g. GET /repos/octokit/octokit.rb.
    • Defaults to /v3/ so you do not need to specify that.
  • V3 Docs

GraphQL API

  • Version: 4
  • API URL: api.github.com/graphql
    • Do POST requests against this single endpoint.
  • Explorer
    • edit and run queries against live data, in the browser. Requires you to sign in.
  • V4 Docs
  • Resource limitations
    • Individual calls cannot request more than 500,000 total nodes.

Tutorials

Learn the basics of REST and GraphQL: