GitHub Gists API

The GitHub Gists API lets you programmatically manage gistslightweight code snippets and notesover HTTP. You can create gists (public or secret/unlisted), read individual gists, list public gists, your own, a users, and those youve starred, fetch raw file contents, view version history and commits, update gists by adding/renaming/removing files or changing descriptions, and delete them. It also supports forking, starring/un-starring and checking star status, plus full CRUD for gist comments.

Operations 20

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /gists List my gists · GitHub List Gists for the Authenticated User #
Ask an LLM
“Which gists have I created?”
“Can I see only the gists I've updated since last week?”
Tell an agent
List my gists.
Show my gists updated since {since}.
POST /gists Create a gist · GitHub Create a Gist #
Ask an LLM
“How do I share a code snippet as a new gist?”
“Can I create a secret gist that holds several files?”
Tell an agent
Create a new gist with files {files}.
Create a gist described as {description} containing {files}, public set to {public}.
GET /gists/public List recent public gists from everyone · GitHub List Public Gists #
Ask an LLM
“What public gists have people shared most recently?”
“Can I browse all public gists posted after a certain date?”
Tell an agent
List the most recent public gists from all users.
Show public gists posted since {since}.
GET /gists/starred List gists I've starred · GitHub List Starred Gists #
Ask an LLM
“Which gists have I starred?”
“Can I find the snippets I bookmarked with a star since a given date?”
Tell an agent
List the gists I've starred.
Show my starred gists updated since {since}.
GET /gists/{gist_id} Get a gist and its files · GitHub Get a Gist #
Ask an LLM
“What files and content are inside a particular gist?”
“Can I fetch the current version of a gist by its ID?”
Tell an agent
Show me gist {gist_id}.
Get the files and contents of gist {gist_id}.
PATCH /gists/{gist_id} Update a gist's description or files · GitHub Update a Gist #
Ask an LLM
“Can I edit the files in a gist I already posted?”
“Is it possible to rename or remove a file inside an existing gist?”
Tell an agent
Change the description of gist {gist_id} to {description}.
Update the files in existing gist {gist_id} to {files}.
DELETE /gists/{gist_id} Delete a gist · GitHub Delete a Gist #
Ask an LLM
“How do I delete a gist I no longer need?”
“Can I remove a gist I posted by mistake?”
Tell an agent destructive · confirm first
Delete gist {gist_id}.
Permanently remove my gist {gist_id}.
GET /gists/{gist_id}/comments List comments on a gist · GitHub List Gist Comments #
Ask an LLM
“What have people commented on a gist?”
“Can I read the full discussion under a gist?”
Tell an agent
List the comments on gist {gist_id}.
Show the discussion under gist {gist_id}.
POST /gists/{gist_id}/comments Comment on a gist · GitHub Create a Gist Comment #
Ask an LLM
“How can I leave a comment on someone's gist?”
“Can I reply to a gist with a note?”
Tell an agent
Comment {body} on gist {gist_id}.
Post a new comment on gist {gist_id} saying {body}.
GET /gists/{gist_id}/comments/{comment_id} Get one gist comment · GitHub Get a Gist Comment #
Ask an LLM
“What does a specific comment on a gist say?”
“Can I fetch a single gist comment by its ID?”
Tell an agent
Show comment {comment_id} on gist {gist_id}.
Get the text of gist {gist_id} comment {comment_id}.
PATCH /gists/{gist_id}/comments/{comment_id} Edit a gist comment · GitHub Update a Gist Comment #
Ask an LLM
“Can I fix a typo in a comment I already posted on a gist?”
“Is editing an existing gist comment supported?”
Tell an agent
Change comment {comment_id} on gist {gist_id} to say {body}.
Edit my existing gist comment {comment_id} on {gist_id} with new text {body}.
DELETE /gists/{gist_id}/comments/{comment_id} Delete a gist comment · GitHub Delete a Gist Comment #
Ask an LLM
“Can I delete a comment I left on a gist?”
“What's the way to remove an unwanted comment from my gist?”
Tell an agent destructive · confirm first
Delete comment {comment_id} from gist {gist_id}.
Remove gist {gist_id} comment {comment_id}.
GET /gists/{gist_id}/commits List a gist's revision history · GitHub List Gist Commits #
Ask an LLM
“How has a gist changed over time — what commits does it have?”
“Can I see who edited a gist and when?”
Tell an agent
List the commits of gist {gist_id}.
Show the revision history of gist {gist_id}.
GET /gists/{gist_id}/forks List forks of a gist · GitHub List Gist Forks #
Ask an LLM
“Who has forked a particular gist?”
“Can I see all the copies people made of my gist?”
Tell an agent
List the forks of gist {gist_id}.
Show everyone who forked gist {gist_id}.
POST /gists/{gist_id}/forks Fork a gist · GitHub Fork a Gist #
Ask an LLM
“How do I make my own copy of someone else's gist?”
“Can I fork a gist so I can edit it separately?”
Tell an agent
Fork gist {gist_id} into my account.
Make my own copy of gist {gist_id}.
GET /gists/{gist_id}/star Check whether I've starred a gist · GitHub Check if a Gist is Starred #
Ask an LLM
“Have I already starred a given gist?”
“Is this gist among my stars?”
Tell an agent
Check whether I've starred gist {gist_id}.
Tell me if gist {gist_id} is in my stars.
PUT /gists/{gist_id}/star Star a gist · GitHub Star a Gist #
Ask an LLM
“Can I star a gist to find it again later?”
“What's the call to bookmark a gist with a star?”
Tell an agent
Star gist {gist_id}.
Add gist {gist_id} to my starred gists.
DELETE /gists/{gist_id}/star Unstar a gist · GitHub Unstar a Gist #
Ask an LLM
“How do I take my star off a gist?”
“Can I remove a gist from my starred list?”
Tell an agent destructive · confirm first
Unstar gist {gist_id}.
Remove gist {gist_id} from my stars.
GET /gists/{gist_id}/{sha} Get a specific revision of a gist · GitHub Get a Gist Revision #
Ask an LLM
“What did a gist look like at an earlier commit?”
“Can I fetch an older version of a gist by its revision SHA?”
Tell an agent
Show gist {gist_id} as it was at revision {sha}.
Get the files of gist {gist_id} at commit {sha}.
GET /users/{username}/gists List another user's public gists · GitHub List Gists for a User #
Ask an LLM
“What public gists has a particular user shared?”
“Can I see someone's gists updated since a certain date?”
Tell an agent
List the public gists of {username}.
Show gists by {username} updated since {since}.

Documentation

Specifications

Schemas & Data

Other Resources

🔗
APIsJSON
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/apis.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/arazzo/github-commit-file-to-new-branch-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/arazzo/github-create-label-and-triage-issue-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/arazzo/github-create-milestone-and-issue-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/arazzo/github-create-org-repository-and-issue-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/arazzo/github-create-repository-and-issue-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/arazzo/github-dispatch-workflow-and-poll-run-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/arazzo/github-fork-and-branch-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/arazzo/github-fork-gist-and-comment-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/arazzo/github-inspect-latest-commit-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/arazzo/github-onboard-org-member-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/arazzo/github-open-and-merge-pull-request-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/arazzo/github-open-pull-request-and-request-reviewers-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/arazzo/github-propose-change-pull-request-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/arazzo/github-provision-org-repo-with-webhook-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/arazzo/github-publish-release-with-asset-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/arazzo/github-report-bug-issue-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/arazzo/github-review-and-merge-pull-request-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/arazzo/github-star-and-comment-gist-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/arazzo/github-tag-commit-and-release-workflow.yml
🔗
Arazzo
https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/arazzo/github-verify-and-merge-branch-workflow.yml

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/github-gists-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

github-gists-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  version: 1.1.4
  title: GitHub v3 REST Gists API
  description: GitHub's v3 REST API.
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  termsOfService: https://docs.github.com/articles/github-terms-of-service
  contact:
    name: Support
    url: https://support.github.com/contact?tags=dotcom-rest-api
  x-github-plan: ghes
  x-github-release: 3.9
servers:
- url: '{protocol}://{hostname}/api/v3'
  variables:
    hostname:
      description: Self-hosted Enterprise Server hostname
      default: HOSTNAME
    protocol:
      description: Self-hosted Enterprise Server protocol
      default: http
tags:


# --- truncated at 32 KB (77 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/github/refs/heads/main/openapi/github-gists-api-openapi.yml