// 응답 내용
{
"message": "Return succeeded.",
"status": 200,
"name": "erukim",
"nickname": "이루",
"url": "https://github.com/erukim",
"company": "@hiplaygit ",
"area": null,
"email": null,
"introduction": "방송을 하면서 개발과 온라인사업을 하는 이루입니다.\r\n@Dev-Korea-Server @MORA-Team @Team-Laon @Team-Social-Dev ",
"info": {
"id": 100296449,
"node": "U_kgDOBfpnAQ",
"gravatar": ""
},
"followers": 5,
"following": 6,
"twitter": null,
"avatarurl": "https://avatars.githubusercontent.com/u/100296449?v=4",
"type": "User",
"creation": "2022-02-23T14:46:16Z",
"update": "2022-11-09T14:29:24Z",
"success": true
}
// node-fetch
const fetch = require('node-fetch')
fetch(`https://mora-bot.kr/api/v2/github?username=[조회할유저 닉네임]`)
.then(res => res.json())
.then(json => {
console.log(json)
});
// request
const request = require('request');
let options = {
url: `https://mora-bot.kr/api/v2/github?username=[조회할유저 닉네임]`
}
request.get(options, function (error, response, body) {
if (!error && response.status == 200) {
let json = JSON.parse(body)
console.log(`조회값 : ${json}`);
} else {
console.log('error = ' + response.errorcode);
}
});
import requests
response = requests.get("https://mora-bot.kr/api/v2/github?username=[조회할유저 닉네임]")
result = response.json()
if response.status_code == 200:
print(result)
else:
print(f"Error Code: {result['status']}")