Skip to content

Github API

Jonah edited this page Nov 22, 2017 · 3 revisions

Github API

Gists

URL: https://developer.github.com/v3/gists/

Response format

{
	"url": "https://api.github.com/gists/f9a4d3936e849f88dacf45f7b37db4a8",
	"forks_url": "https://api.github.com/gists/f9a4d3936e849f88dacf45f7b37db4a8/forks",
	"commits_url": "https://api.github.com/gists/f9a4d3936e849f88dacf45f7b37db4a8/commits",
	"id": "f9a4d3936e849f88dacf45f7b37db4a8",
	"git_pull_url": "https://gist.github.com/f9a4d3936e849f88dacf45f7b37db4a8.git",
	"git_push_url": "https://gist.github.com/f9a4d3936e849f88dacf45f7b37db4a8.git",
	"html_url": "https://gist.github.com/f9a4d3936e849f88dacf45f7b37db4a8",
	"files": {
		"test.txt": {
			"filename": "test.txt",
			"type": "text/plain",
			"language": "Text",
			"raw_url": "https://gist.githubusercontent.com/anonymous/f9a4d3936e849f88dacf45f7b37db4a8/raw/59bcab339ae22425f2b376f9a345e6177ef7a29f/test.txt",
			"size": 17,
			"truncated": false,
			"content": "test content 2826"
		}
	},
	"public": false,
	"created_at": "2017-11-21T11:47:13Z",
	"updated_at": "2017-11-21T11:47:13Z",
	"description": null,
	"comments": 0,
	"user": null,
	"comments_url": "https://api.github.com/gists/f9a4d3936e849f88dacf45f7b37db4a8/comments",
	"forks": [],
	"history": [{
		"user": {
			"login": "invalid-email-address",
			"id": 148100,
			"avatar_url": "https://avatars0.githubusercontent.com/u/148100?v=4",
			"gravatar_id": "",
			"url": "https://api.github.com/users/invalid-email-address",
			"html_url": "https://github.com/invalid-email-address",
			"followers_url": "https://api.github.com/users/invalid-email-address/followers",
			"following_url": "https://api.github.com/users/invalid-email-address/following{/other_user}",
			"gists_url": "https://api.github.com/users/invalid-email-address/gists{/gist_id}",
			"starred_url": "https://api.github.com/users/invalid-email-address/starred{/owner}{/repo}",
			"subscriptions_url": "https://api.github.com/users/invalid-email-address/subscriptions",
			"organizations_url": "https://api.github.com/users/invalid-email-address/orgs",
			"repos_url": "https://api.github.com/users/invalid-email-address/repos",
			"events_url": "https://api.github.com/users/invalid-email-address/events{/privacy}",
			"received_events_url": "https://api.github.com/users/invalid-email-address/received_events",
			"type": "User",
			"site_admin": false
		},
		"version": "c302a3a900f08e227c583a2c45ad85d36041cbb0",
		"committed_at": "2017-11-21T11:47:12Z",
		"change_status": {
			"total": 1,
			"additions": 1,
			"deletions": 0
		},
		"url": "https://api.github.com/gists/f9a4d3936e849f88dacf45f7b37db4a8/c302a3a900f08e227c583a2c45ad85d36041cbb0"
	}],
	"truncated": false
}

List format

{
	"gists": [{
		"id": "86c0aad7e1101c052ca578bac152843d",
		"url": "https://api.github.com/gists/86c0aad7e1101c052ca578bac152843d",
		"html_url": "https://gist.github.com/86c0aad7e1101c052ca578bac152843d",
		"created_at": "2017-11-22T11:01:24Z",
		"description": "",
		"files": {
			"a.txt": {
				"filename": "a.txt",
				"type": "text/plain",
				"language": "Text",
				"raw_url": "https://gist.githubusercontent.com/anonymous/86c0aad7e1101c052ca578bac152843d/raw/6f3a76fdaecc59dc547d60555b517bfd8247ea61/a.txt",
				"size": 14
			}
		}
	}, {
		"id": "147acbfb299755171a4d0e90d03c0e64",
		"url": "https://api.github.com/gists/147acbfb299755171a4d0e90d03c0e64",
		"html_url": "https://gist.github.com/147acbfb299755171a4d0e90d03c0e64",
		"created_at": "2017-11-22T11:01:25Z",
		"description": "",
		"files": {
			"b.txt": {
				"filename": "b.txt",
				"type": "text/plain",
				"language": "Text",
				"raw_url": "https://gist.githubusercontent.com/anonymous/147acbfb299755171a4d0e90d03c0e64/raw/959a8a2bbf72807b795cc2c4dbe4c23ffc6746e6/b.txt",
				"size": 14
			}
		}
	}]
}

Clone this wiki locally