GitHub REST API - GitHub Docs

octokit/rest.js

특별히 헤더에 대한 설명이 없으면 Request 헤더는 아래와 같다.

Accept: application/vnd.github+json

토큰이 필요하다면 아래 헤더를 추가한다.

Authorization: Bearer <YOUR-TOKEN>

공개적 유저 정보 - Docs

**GET** /users/{username}

octokit.rest.users.getByUsername({
  username,
});
{
	"login": "wkddntjr1123",
	"id": 64186072,
	"node_id": "MDQ6VXNlcjY0MTg2MDcy",
	"avatar_url": "<https://avatars.githubusercontent.com/u/64186072?v=4>",
	"url": "<https://api.github.com/users/wkddntjr1123>",
	// following과 followers 정보 얻기 가능
  "followers_url": "<https://api.github.com/users/wkddntjr1123/followers>",
	"following_url": "<https://api.github.com/users/wkddntjr1123/following{/other_user}>",
	"starred_url": "<https://api.github.com/users/wkddntjr1123/starred{/owner}{/repo}>",
	"subscriptions_url": "<https://api.github.com/users/wkddntjr1123/subscriptions>",
	// public인 organization 목록
  "organizations_url": "<https://api.github.com/users/wkddntjr1123/orgs>",
	"repos_url": "<https://api.github.com/users/wkddntjr1123/repos>",
	"events_url": "<https://api.github.com/users/wkddntjr1123/events{/privacy}>",
	"received_events_url": "<https://api.github.com/users/wkddntjr1123/received_events>",
	"type": "User",
	"site_admin": false,
	"name": "장우석",
	"company": null,
	"blog": "<https://wkddntjr1123.github.io/>",
	"location": null,
	"email": null,
	"hireable": null,
	"bio": null,
	"twitter_username": null,
	"public_repos": 18,
	"public_gists": 4,
	"followers": 19,
	"following": 21,
	"created_at": "2020-04-23T05:36:29Z",
	"updated_at": "2022-11-06T11:38:48Z",
	"private_gists": 16,
	"total_private_repos": 10,
	"owned_private_repos": 7,
	"disk_usage": 405743,
	"collaborators": 0,
	"two_factor_authentication": false,
	"plan": {
		"name": "pro",
		"space": 976562499,
		"collaborators": 0,
		"private_repos": 9999
	}
}

비공개 유저 정보 - Docs

**GET** /user