GitHub v3 REST API

List public gists

List public gists sorted by most recently updated to least recently updated.

Note: With pagination, you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page.

get
{protocol}://{hostname}/api/v3/gists/public

Query Parameters

sincestring(date-time)

Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Response

application/json

Response

Base Gist

urlstring(uri)required
forks_urlstring(uri)required
commits_urlstring(uri)required
idstringrequired
node_idstringrequired
git_pull_urlstring(uri)required
git_push_urlstring(uri)required
html_urlstring(uri)required
filesobjectrequired
publicbooleanrequired
created_atstring(date-time)required
updated_atstring(date-time)required
descriptionstring | nullrequired
commentsintegerrequired
userobject | nullrequired

Simple User

Show Child Parameters
comments_urlstring(uri)required
ownerobject

Simple User

Show Child Parameters
truncatedboolean
forksarray
historyarray
get/gists/public
 
application/json

List starred gists

List the authenticated user’s starred gists:

get
{protocol}://{hostname}/api/v3/gists/starred

Query Parameters

sincestring(date-time)

Only show notifications updated after the given time. This is a timestamp in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ.

per_pageinteger

Results per page (max 100)

Default:30

pageinteger

Page number of the results to fetch.

Default:1

Response

application/json

Response

Base Gist

urlstring(uri)required
forks_urlstring(uri)required
commits_urlstring(uri)required
idstringrequired
node_idstringrequired
git_pull_urlstring(uri)required
git_push_urlstring(uri)required
html_urlstring(uri)required
filesobjectrequired
publicbooleanrequired
created_atstring(date-time)required
updated_atstring(date-time)required
descriptionstring | nullrequired
commentsintegerrequired
userobject | nullrequired

Simple User

Show Child Parameters
comments_urlstring(uri)required
ownerobject

Simple User

Show Child Parameters
truncatedboolean
forksarray
historyarray
get/gists/starred
 
application/json

Get a gist

get
{protocol}://{hostname}/api/v3/gists/{gist_id}

Path Parameters

gist_idstringrequired

gist_id parameter

Response

application/json

Response

Gist Simple

Gist Simple

forksarray | null[object]DEPRECATED
Show Child Parameters
historyarray | null[object]DEPRECATED

Gist History

Show Child Parameters
fork_ofobject | null

Gist

Show Child Parameters
urlstring
forks_urlstring
commits_urlstring
idstring
node_idstring
git_pull_urlstring
git_push_urlstring
html_urlstring
filesobject
publicboolean
created_atstring
updated_atstring
descriptionstring | null
commentsinteger
userstring | null
comments_urlstring
ownerobject

Simple User

Show Child Parameters
truncatedboolean
get/gists/{gist_id}
 
application/json

Update a gist

Allows you to update or delete a gist file and rename gist files. Files from the previous version of the gist that aren’t explicitly changed during an edit are unchanged.

patch
{protocol}://{hostname}/api/v3/gists/{gist_id}

Path Parameters

gist_idstringrequired

gist_id parameter

Body

application/json
Any Of

Response

application/json

Response

Gist Simple

Gist Simple

forksarray | null[object]DEPRECATED
Show Child Parameters
historyarray | null[object]DEPRECATED

Gist History

Show Child Parameters
fork_ofobject | null

Gist

Show Child Parameters
urlstring
forks_urlstring
commits_urlstring
idstring
node_idstring
git_pull_urlstring
git_push_urlstring
html_urlstring
filesobject
publicboolean
created_atstring
updated_atstring
descriptionstring | null
commentsinteger
userstring | null
comments_urlstring
ownerobject

Simple User

Show Child Parameters
truncatedboolean
patch/gists/{gist_id}

Body

{}
 
application/json

Delete a gist

delete
{protocol}://{hostname}/api/v3/gists/{gist_id}

Path Parameters

gist_idstringrequired

gist_id parameter

Response

Response

delete/gists/{gist_id}