{
 "kind": "api",
 "slug": "github",
 "path": "apis/github/",
 "name": "GitHub",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "APIs",
   "apis/"
  ],
  [
   "Integrations and automation",
   "apis/automation/"
  ]
 ],
 "lead": "Let your app or AI agent work with code projects.",
 "chips": [
  {
   "label": "Integrations and automation",
   "path": "apis/automation/"
  }
 ],
 "primary": {
  "label": "Copy prompt for your agent",
  "copy": "Use the GitHub API with octokit 5.0.5 on the server: read a fine-grained token from GITHUB_TOKEN in .env, send a clear User-Agent, handle 403/429 by waiting for x-ratelimit-reset, and paginate list results."
 },
 "links": [
  {
   "label": "Website",
   "href": "https://github.com"
  },
  {
   "label": "Pricing",
   "href": "https://github.com/pricing"
  },
  {
   "label": "GitHub",
   "href": "https://github.com/octokit/octokit.js"
  }
 ],
 "track": "Outages, price changes and new versions on your dashboard",
 "verdicts": [
  {
   "key": "price",
   "label": "Price",
   "value": "Free every month",
   "status": "yes",
   "sub": "Then from $4/mo",
   "quote": "2,000 ci/cd minutes/month 500mb of packages storage",
   "note": "Free tier: Unlimited public/private repositories, 2,000 CI/CD minutes/month, 500MB Packages storage. As reported on the official pricing page, checked Oct 26, 2026.",
   "src": "https://github.com/pricing"
  },
  {
   "key": "commercial",
   "label": "Commercial use",
   "value": "With conditions",
   "status": "cond",
   "sub": null,
   "quote": "You may not share API tokens to exceed GitHub's rate limitations.",
   "note": "Allowed under GitHub's terms; no spam, no selling users' personal data, no sharing tokens to exceed limits, and high-throughput or resale use needs a separate subscription.",
   "src": "https://docs.github.com/en/site-policy/github-terms/github-terms-of-service"
  },
  {
   "key": "key",
   "label": "Key & sign-up",
   "value": "API key, server only",
   "status": "info",
   "sub": "Env var No name is read automatically by Octokit; GitHub CLI reads GH_TOKEN, and Actions provides GITHUB_TOKEN",
   "quote": "After creating a token, you can authenticate your request by sending the token in the Authorization header of your request.",
   "note": "A token in the Authorization header (Authorization: Bearer <token>): a fine-grained personal access token, a GitHub App token, or the built-in GITHUB_TOKEN in GitHub Actions. Public data can be read without a token.",
   "src": "https://docs.github.com/api/article/body?pathname=/en/rest/authentication/authenticating-to-the-rest-api"
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Docs for agents",
   "status": "info",
   "sub": "llms.txt · SDK",
   "quote": "The remote GitHub MCP Server is hosted by GitHub and provides the easiest method for getting up and running.",
   "note": " Our agent check: 3 of 6 (Nov 13, 2026).",
   "src": "https://github.com/github/github-mcp-server/blob/main/README.md"
  }
 ],
 "vfoot": "Checked against the maker's official pages, pricing on Oct 26, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What GitHub does",
   "parts": [
    {
     "t": "prose",
     "text": "The GitHub API lets your app, script or AI assistant do in code what you do on github.com, such as reading a project, opening an issue or publishing a release. Public data can be read without an account, at a low hourly limit. With a personal token it can act on your own projects."
    },
    {
     "t": "list",
     "items": [
      "GitHub is one of 17 APIs in the Integrations and automation category on AgentGid.",
      "Its cheapest paid plan ($4 a month) is the 2nd cheapest of the 15 here with a monthly plan.",
      "It is one of 16 that can be started for free.",
      "6 of them ship an official MCP server; GitHub does not.",
      "Its official SDK is the 1st most downloaded in the category (14.8M a week)."
     ],
     "muted": true
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Project stats on your website",
       "text": "Show the star count, license and latest release of your open-source project on your landing page, read live from GitHub.",
       "idea": true
      },
      {
       "title": "Feedback form that opens issues",
       "text": "Turn a bug report from your app's feedback form into an issue in your project, so nothing gets lost in email.",
       "idea": false
      },
      {
       "title": "Jobs that run inside your project",
       "text": "Run a scheduled or one-click job in GitHub Actions that reads or updates issues, with a built-in token and no key to manage.",
       "idea": false
      },
      {
       "title": "Your AI assistant works on GitHub",
       "text": "Let an AI assistant read code, triage issues and review pull requests in your projects through GitHub's own MCP server.",
       "idea": false
      },
      {
       "title": "Deploy or notify when code changes",
       "text": "Get a message on your server when someone pushes code or opens a pull request, then deploy the site or post to your team chat.",
       "idea": false
      },
      {
       "title": "Content stored in a project",
       "text": "Keep blog posts or app settings as files in a GitHub project and have your site read and update them.",
       "idea": true
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "GitHub popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "4M",
       "l": "SDK downloads a week",
       "d": "-24.7% on the 4-week average",
       "up": false
      },
      {
       "n": "54",
       "l": "public agent repos use its SDK"
      },
      {
       "n": "7,880",
       "l": "GitHub stars, octokit/octokit.js"
      }
     ]
    },
    {
     "t": "small",
     "text": "SDK downloads from npm and PyPI, weekly. Numbers as of Nov 17, 2026."
    }
   ]
  },
  {
   "id": "pricing",
   "nav": "Pricing and limits",
   "h2": "Pricing",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Free tier",
       "v": "Unlimited public/private repositories, 2,000 CI/CD minutes/month, 500MB Packages storage"
      },
      {
       "l": "Cheapest plan",
       "v": "$4 a month"
      },
      {
       "l": "Usage price",
       "v": "GitHub Codespaces: $0.18/hour compute, $0.07/GB storage/month"
      },
      {
       "l": "Plans",
       "v": "Added automatically: its SDK was in 161 of the public agent repos we sampled when it was added; integrations in CrewAI, LlamaIndex. Prices read from the official pricing page."
      }
     ]
    },
    {
     "t": "h3",
     "text": "What one action costs"
    },
    {
     "t": "table",
     "head": [
      "Action",
      "Price"
     ],
     "num": true,
     "rows": [
      [
       "Free plan for a month (API access within rate limits, 2,000 CI/CD minutes)",
       "$0"
      ],
      [
       "Team plan, one user for a month",
       "$4"
      ]
     ]
    },
    {
     "t": "more",
     "items": [
      {
       "title": "Price history",
       "items": [
        "A year of the pricing page in the Internet Archive (13 months): the lowest monthly figure went from $5 (2025-10) to $5 (2026-10)."
       ]
      }
     ]
    },
    {
     "t": "small",
     "text": "As reported on the official pricing page, checked Oct 26, 2026. Prices change: confirm before you buy.",
     "link": "github.com/pricing",
     "href": "https://github.com/pricing"
    }
   ]
  },
  {
   "id": "limits",
   "nav": null,
   "spy_as": "pricing",
   "h2": "Limits",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "No token",
       "v": "60 requests per hour per IP address, public data only",
       "src": "https://docs.github.com/api/article/body?pathname=/en/rest/using-the-rest-api/rate-limits-for-the-rest-api"
      },
      {
       "l": "Personal access token",
       "v": "5,000 requests per hour per user",
       "src": "https://docs.github.com/api/article/body?pathname=/en/rest/using-the-rest-api/rate-limits-for-the-rest-api"
      },
      {
       "l": "GITHUB_TOKEN in Actions",
       "v": "1,000 requests per hour per repository",
       "src": "https://docs.github.com/api/article/body?pathname=/en/rest/using-the-rest-api/rate-limits-for-the-rest-api"
      },
      {
       "l": "All",
       "v": "At most 100 requests at the same time; about 80 content-creating requests a minute and 500 an hour",
       "src": "https://docs.github.com/api/article/body?pathname=/en/rest/using-the-rest-api/rate-limits-for-the-rest-api"
      },
      {
       "l": "All",
       "v": "Requests taking over 10 seconds are cut off",
       "src": "https://docs.github.com/api/article/body?pathname=/en/rest/using-the-rest-api/troubleshooting-the-rest-api"
      }
     ]
    },
    {
     "t": "small",
     "text": "From the official docs.",
     "link": "docs.github.com/api/article/body?pathname=/en/rest/using-the-rest-api/rate-limits-for-the-rest-api",
     "href": "https://docs.github.com/api/article/body?pathname=/en/rest/using-the-rest-api/rate-limits-for-the-rest-api"
    }
   ]
  },
  {
   "id": "access",
   "nav": "Access and terms",
   "h2": "Key and access",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "How it signs in",
       "v": "A token in the Authorization header (Authorization: Bearer <token>): a fine-grained personal access token, a GitHub App token, or the built-in GITHUB_TOKEN in GitHub Actions. Public data can be read without a token."
      },
      {
       "l": "Environment variable",
       "v": "No name is read automatically by Octokit; GitHub CLI reads GH_TOKEN, and Actions provides GITHUB_TOKEN",
       "code": true
      },
      {
       "l": "Safe in browser code",
       "v": "No, keep it on your server",
       "status": "no"
      },
      {
       "l": "Card at sign-up",
       "v": "No"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Steps only a person can do"
    },
    {
     "t": "list",
     "items": [
      "Sign in to GitHub and create a fine-grained personal access token for the repositories the app needs. Put it in .env as GITHUB_TOKEN (kept out of git) and pass it to new Octokit({ auth }) on the server.",
      "To act for other users or an organization, register a GitHub App and install it on the organization. Store the app's client ID and private key as secrets and create installation tokens in code.",
      "For jobs inside GitHub Actions, set the workflow's permissions block; no token needs creating. Use secrets.GITHUB_TOKEN as GH_TOKEN in the workflow step."
     ]
    }
   ]
  },
  {
   "id": "terms",
   "nav": null,
   "spy_as": "access",
   "h2": "Commercial use and your data",
   "parts": [
    {
     "t": "prose",
     "text": "Calling the GitHub API costs nothing within the rate limits. You may build paid products on it, but not spam people, sell users' personal data, or share tokens to get past the limits."
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In a paid app",
       "v": "With conditions",
       "status": "cond",
       "sub": "Allowed under GitHub's terms; no spam, no selling users' personal data, no sharing tokens to exceed limits, and high-throughput or resale use needs a separate subscription.",
       "quote": "You may not share API tokens to exceed GitHub's rate limitations.",
       "src": "https://docs.github.com/en/site-policy/github-terms/github-terms-of-service"
      },
      {
       "l": "inside-app-bundle",
       "v": "Yes",
       "status": "yes",
       "sub": "The octokit package is MIT licensed and can ship inside your app.",
       "quote": "\"license\":\"MIT\"",
       "src": "https://registry.npmjs.org/octokit/5.0.5"
      },
      {
       "l": "To train your own AI",
       "v": "With conditions",
       "status": "cond",
       "sub": "The terms do not ban collecting public data through the API, but it may not be used for spam or to sell personal information, and the privacy statement applies.",
       "quote": "Your use of information from the Service must comply with the GitHub Privacy Statement",
       "src": "https://docs.github.com/en/site-policy/acceptable-use-policies/github-acceptable-use-policies"
      },
      {
       "l": "Where data is stored",
       "v": "github.com is one global service; GitHub Enterprise Cloud with data residency runs on its own ghe.com address.",
       "quote": null,
       "src": null
      }
     ]
    }
   ]
  },
  {
   "id": "errors",
   "nav": null,
   "spy_as": "access",
   "h2": "Errors to handle",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "401",
       "v": "The token is invalid; after several bad attempts GitHub briefly refuses all logins for that user with 403.",
       "sub": "Check the token, its expiry and the Authorization header; stop retrying with a bad token."
      },
      {
       "l": "403 or 429 (rate limit)",
       "v": "The hourly limit or a secondary limit was hit; x-ratelimit-remaining is 0 or the message names a secondary limit.",
       "sub": "Wait for retry-after or x-ratelimit-reset, otherwise at least a minute, then back off exponentially."
      },
      {
       "l": "404",
       "v": "Often not missing at all; a private resource without proper access returns 404 instead of 403.",
       "sub": "Check the token's permissions, owner and repository access, the URL (no trailing slash) and the HTTP method."
      },
      {
       "l": "403 (resource not accessible)",
       "v": "The fine-grained token or GitHub App lacks a permission the endpoint needs.",
       "sub": "Read the X-Accepted-GitHub-Permissions header and add exactly that permission to the token or app."
      },
      {
       "l": "422",
       "v": "The request body failed validation, or the endpoint has been spammed.",
       "sub": "Fix the fields named in the error; slow down content-creating requests."
      }
     ]
    }
   ]
  },
  {
   "id": "agent",
   "nav": "For agents",
   "h2": "Use it from an agent",
   "parts": [
    {
     "t": "rows",
     "rows": [
      {
       "l": "Our agent check",
       "v": "3 of 6: llms.txt yes, OpenAPI no, SDK yes, MCP no, status page no, AI assistants allowed yes",
       "sub": "Checked Nov 13, 2026."
      },
      {
       "l": "MCP server",
       "v": "GitHub MCP Server (remote, hosted by GitHub; also runs locally in Docker)",
       "sub": "claude mcp add-json github '{\"type\":\"http\",\"url\":\"https://api.githubcopilot.com/mcp\",\"headers\":{\"Authorization\":\"Bearer YOUR_GITHUB_PAT\"}}'"
      },
      {
       "l": "npm",
       "v": "npm install octokit",
       "code": true
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "GitHub",
       "me": true,
       "facts": [
        "from $0.07/GB storage",
        "Free tier"
       ]
      },
      {
       "name": "Trigger.dev",
       "why": "Pick Trigger.dev when you need long-running background tasks with no timeouts, not jobs tied to a code project.",
       "path": "apis/trigger-dev/",
       "facts": [
        "$0.025 / 1k requests",
        "Free tier"
       ]
      },
      {
       "name": "Inngest",
       "why": "Pick Inngest when your app needs event-driven background functions and agent workflows that retry on their own.",
       "path": "apis/inngest/",
       "facts": [
        "$0.05 / 1k requests",
        "Free tier"
       ]
      },
      {
       "name": "Arcade",
       "why": "Pick Arcade when your AI agent must act in many outside services, GitHub among them, with sign-ins handled for each user.",
       "path": "apis/arcade/",
       "facts": [
        "$10 / 1k requests",
        "Free tier",
        "Official MCP"
       ]
      }
     ],
     "more": "All integrations and automation APIs",
     "more_path": "apis/automation/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "Use the GitHub API with octokit 5.0.5 on the server: read a fine-grained token from GITHUB_TOKEN in .env, send a clear User-Agent, handle 403/429 by waiting for x-ratelimit-reset, and paginate list results."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Create a fine-grained personal access token with only the permissions and repositories you need, and an expiry date.",
       "code": null,
       "src": "https://docs.github.com/api/article/body?pathname=/en/rest/authentication/keeping-your-api-credentials-secure"
      },
      {
       "text": "Install Octokit for JavaScript (or call the API with curl or any web request).",
       "code": "npm install octokit",
       "src": "https://docs.github.com/api/article/body?pathname=/en/rest/quickstart"
      },
      {
       "text": "Create a client with your token and send a request.",
       "code": "const octokit = new Octokit({\n  auth: 'YOUR-TOKEN'\n});\nawait octokit.request(\"GET /repos/{owner}/{repo}/issues\", {\n  owner: \"octocat\",\n  repo: \"Spoon-Knife\",\n});\n",
       "src": "https://docs.github.com/api/article/body?pathname=/en/rest/quickstart"
      }
     ]
    },
    {
     "t": "h3",
     "text": "First request"
    },
    {
     "t": "tabs",
     "label": "First request",
     "items": [
      {
       "tab": "Request",
       "code": "curl -L \\\n  -X POST \\\n  -H \"Accept: application/vnd.github+json\" \\\n  -H \"Authorization: Bearer <YOUR-TOKEN>\" \\\n  -H \"X-GitHub-Api-Version: 2026-03-10\" \\\n  https://api.github.com/repos/OWNER/REPO/issues \\\n  -d '{\"title\":\"Found a bug\",\"body\":\"I'\\''m having a problem with this.\",\"assignees\":[\"octocat\"],\"milestone\":1,\"labels\":[\"bug\"]}'\n",
       "intro": null
      },
      {
       "tab": "Response",
       "code": "Status: 201\n{\n  \"id\": 1,\n  \"url\": \"https://api.github.com/repos/octocat/Hello-World/issues/1347\",\n  \"html_url\": \"https://github.com/octocat/Hello-World/issues/1347\",\n  \"number\": 1347,\n  \"state\": \"open\",\n  \"title\": \"Found a bug\",\n  \"body\": \"I'm having a problem with this.\",\n  \"user\": { \"login\": \"octocat\", \"id\": 1 }\n}\n"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "Calling the API from a script with no User-Agent header.",
       "fix": "Send User-Agent with your app name or GitHub username (curl and Octokit send one by default).",
       "why": "Requests without it are rejected, and an invalid one gets 403."
      },
      {
       "dont": "A classic personal access token with the full repo scope and no expiry.",
       "fix": "A fine-grained token limited to the needed repositories and permissions, with an expiry date.",
       "why": "A token can do everything its owner can within its scopes."
      },
      {
       "dont": "Treating 404 as \"this project does not exist\".",
       "fix": "First check the token's permissions and repository access, the URL and the HTTP method.",
       "why": "GitHub hides private resources behind 404, and a wrong method also gives 404."
      },
      {
       "dont": "Firing many requests in parallel or retrying at once after a 403 or 429.",
       "fix": "Send requests one after another, wait a second between writes, and honour retry-after and x-ratelimit-reset.",
       "why": "Continuing while rate limited can get the integration banned."
      },
      {
       "dont": "Reading only the first answer of a list endpoint.",
       "fix": "Follow pagination (Octokit's paginate helper or the Link header) until there are no more pages.",
       "why": "Most lists return 30 items by default."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Do I need an account to use the GitHub API?",
       "a": "Not for public data; you can read it without a token, up to 60 requests an hour. Writing or reading private data needs a token.",
       "evidence": {
        "url": "https://docs.github.com/api/article/body?pathname=/en/rest/using-the-rest-api/rate-limits-for-the-rest-api",
        "quote": "You can make unauthenticated requests if you are only fetching public data."
       }
      },
      {
       "q": "Which token should I use?",
       "a": "For yourself, a fine-grained personal access token; for acting on behalf of an organization or other users, a GitHub App; inside Actions, GITHUB_TOKEN.",
       "evidence": {
        "url": "https://docs.github.com/api/article/body?pathname=/en/rest/authentication/keeping-your-api-credentials-secure",
        "quote": "To use the API on behalf of an organization or another user, you should create a GitHub App."
       }
      },
      {
       "q": "Why do I get 404 for a project that exists?",
       "a": "GitHub answers 404 for private resources you are not allowed to see; check the token's access.",
       "evidence": {
        "url": "https://docs.github.com/api/article/body?pathname=/en/rest/using-the-rest-api/troubleshooting-the-rest-api",
        "quote": "If you make a request to access a private resource and your request isn't properly authenticated, you will receive a 404 Not Found response."
       }
      },
      {
       "q": "How do I avoid checking for changes over and over?",
       "a": "Subscribe to webhooks, which send events to your server as they happen.",
       "evidence": {
        "url": "https://docs.github.com/api/article/body?pathname=/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api",
        "quote": "You should subscribe to webhook events instead of polling the API for data."
       }
      },
      {
       "q": "Is there an MCP server for my AI assistant?",
       "a": "Yes, GitHub's own MCP server, hosted by GitHub or run locally; it signs in with OAuth or a personal access token.",
       "evidence": {
        "url": "https://github.com/github/github-mcp-server/blob/main/README.md",
        "quote": "The GitHub MCP Server connects AI tools directly to GitHub's platform."
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Maker",
   "GitHub"
  ],
  [
   "Category",
   "Integrations and automation"
  ],
  [
   "Price",
   "from $0.07/GB storage"
  ],
  [
   "Plans from",
   "$4/mo"
  ],
  [
   "Official SDK",
   "npm octokit"
  ],
  [
   "Latest SDK",
   "5.0.5 on npm"
  ],
  [
   "Agent check",
   "3 of 6"
  ],
  [
   "Pricing checked",
   "Oct 26, 2026"
  ]
 ],
 "good": [
  "Without a token you get 60 requests an hour from your internet address; a personal token raises this to 5,000.",
  "Every request needs a User-Agent header naming your app; requests without one are rejected.",
  "Lists return only 30 items by default; ask for the next pages to see the rest."
 ],
 "checked_line": "Read by AgentGid from 28 official pages, card checked Nov 10, 2026; usage numbers update daily."
}