본문으로 건너뛰기

API Reference

플래닛어스는 서버 내 데이터에 접근할 수 있는 공개 REST API를 제공합니다.
국가 디스코드 봇 제작, 외부 사이트 연동, 자동화 등 다양한 용도로 활용할 수 있습니다.

기본 정보

항목내용
Base URLhttps://api.planetearth.kr
응답 형식JSON
인증없음 (공개 API)
캐시 TTL5분 (일반) / 1시간 (Mojang 닉네임·UUID 변환)

요청 제한

종류제한
일반 엔드포인트IP당 15분에 70회
Bulk 엔드포인트IP당 15분에 5회

응답 형식

모든 응답은 status 필드를 포함합니다.

성공

{
"status": "SUCCESS",
"data": [ ... ]
}

실패

{
"status": "FAILED",
"error": {
"code": "NO_DATA_FOUND",
"message": "주어진 입력에 맞는 정보를 찾을 수 없습니다."
}
}

에러 코드

코드HTTP설명
NO_DATA_FOUND404조건에 맞는 데이터 없음
NO_PARAMETER_PROVIDED400파라메터 누락
MULTIPLE_PARAMETERS_PROVIDED400파라메터 2개 이상 입력
INVALID_PARAMETERS_PROVIDED400파라메터 형식 오류
INVALID_NAME_PROVIDED404존재하지 않는 마인크래프트 닉네임
RATE_LIMITED429요청 횟수 초과
UPSTREAM_ERROR502 / 503외부 API 연결 실패 (지도 서버: 502, Mojang API: 503)
SERVER_ERROR500서버 내부 오류

엔드포인트

마을

GET /town

이름 또는 UUID로 마을 정보를 조회합니다.

Query Parameters

파라메터타입설명
namestring마을 이름
uuidstring마을 UUID

파라메터는 하나만 입력해야 합니다.

Response Fields

필드타입설명
namestring마을 이름
uuidstring마을 UUID
mayorstring마을장 닉네임
nationstring소속 국가 이름
residentsstring주민 목록 (, 구분)
memberCountnumber전체 주민 수
onlineMemberCountnumber현재 온라인 주민 수
onlineMembersstring현재 온라인 주민 목록 (, 구분)
claimSizenumber클레임한 청크 수
balancenumber마을 잔고
townBoardstring마을 게시판 내용
trustedResidentsstring트러스트 주민 목록
outlawsstring아웃로 목록
founderstring마을 설립자
registerednumber마을 설립일 (Unix ms)
joinedNationAtnumber국가 가입일 (Unix ms)
spawnstring마을 스폰 좌표

Example Request

GET https://api.planetearth.kr/town?name=Dev_Island

Example Response

{
"status": "SUCCESS",
"data": [
{
"name": "Dev_Island",
"uuid": "36315f61-0685-4668-865c-87e0ca85cfda",
"mayor": "aceda8",
"nation": "Dev",
"residents": "aceda8, ashpoints, Heiz, Irochi_, I_loveryo, LonelyUniverse_, MA5O, Maltes_, Royang_, Squirrel, TownyAPI, Virtual_Tabi, Yellim",
"memberCount": 13,
"onlineMemberCount": 1,
"onlineMembers": "Heiz",
"claimSize": 82,
"balance": 512031.0,
"townBoard": "d",
"trustedResidents": "",
"outlaws": "",
"founder": "Irochi_",
"registered": 1663982084499,
"joinedNationAt": 1725978155425,
"spawn": "world, -1682.9804406008402, 130.0, 5095.724900104271, 37.90424, 5.7425537"
}
]
}

GET /town/list

모든 마을의 이름과 UUID 목록을 반환합니다.

Response Fields

필드타입설명
namestring마을 이름
uuidstring마을 UUID

Example Request

GET https://api.planetearth.kr/town/list

GET /town/bulk

모든 마을의 전체 정보를 반환합니다.
onlineMemberCount, onlineMembers 필드는 포함되지 않습니다.

Bulk Endpoint — 15분당 5회 제한

Example Request

GET https://api.planetearth.kr/town/bulk

국가

GET /nation

이름 또는 UUID로 국가 정보를 조회합니다.

Query Parameters

파라메터타입설명
namestring국가 이름
uuidstring국가 UUID

파라메터는 하나만 입력해야 합니다.

Response Fields

필드타입설명
namestring국가 이름
uuidstring국가 UUID
capitalstring수도 마을 이름
leaderstring국왕 닉네임
townsstring소속 마을 목록 (, 구분)
memberCountnumber전체 주민 수
balancenumber국가 잔고
alliesstring동맹 국가 목록
enemiesstring적대 국가 목록
nationBoardstring국가 게시판 내용
registerednumber국가 설립일 (Unix ms)

Example Request

GET https://api.planetearth.kr/nation?name=Dev

Example Response

{
"status": "SUCCESS",
"data": [
{
"name": "Dev",
"uuid": "6bcf7309-d828-4a83-88fb-02a63d69d821",
"capital": "Dev_Island",
"leader": "aceda8",
"towns": "Dev_Island",
"memberCount": 13,
"balance": 956188.0,
"allies": "",
"enemies": "",
"nationBoard": "/nation set board [메세지]",
"registered": 1725978155425
}
]
}

GET /nation/list

모든 국가의 이름과 UUID 목록을 반환합니다.

Response Fields

필드타입설명
namestring국가 이름
uuidstring국가 UUID

Example Request

GET https://api.planetearth.kr/nation/list

GET /nation/bulk

모든 국가의 전체 정보를 반환합니다.

Bulk Endpoint — 15분당 5회 제한

Example Request

GET https://api.planetearth.kr/nation/bulk

주민

GET /resident

닉네임, UUID, 또는 마을 이름으로 주민 정보를 조회합니다.
마을 이름으로 조회 시 해당 마을 소속 주민 전체가 반환됩니다.

Query Parameters

파라메터타입설명
namestring마인크래프트 닉네임
uuidstring마인크래프트 UUID
townstring마을 이름

파라메터는 하나만 입력해야 합니다.

Response Fields

필드타입설명
namestring닉네임
uuidstringUUID
townstring소속 마을
nationstring소속 국가
townRanksstring마을 직위
nationRanksstring국가 직위
titlestring칭호 (이름 앞)
surnamestring칭호 (이름 뒤)
balancenumber잔고
friendsstring친구 목록
registerednumber첫 접속일 (Unix ms)
lastOnlinenumber마지막 접속일 (Unix ms)
joinedTownAtnumber마을 가입일 (Unix ms)
onlineboolean현재 온라인 여부

Example Request

GET https://api.planetearth.kr/resident?name=Irochi_

Example Response

{
"status": "SUCCESS",
"data": [
{
"name": "Irochi_",
"uuid": "626dfe3b-7820-48c7-9974-1e332b4ffe60",
"town": "Dev_Island",
"nation": "Dev",
"townRanks": "",
"nationRanks": "군인, PVP",
"title": "",
"surname": "",
"balance": 5448.0,
"friends": "",
"registered": 1663865955658,
"lastOnline": 1777807004043,
"joinedTownAt": 1766499540032,
"online": false
}
]
}

GET /resident/list

모든 주민의 이름과 UUID 목록을 반환합니다.

Response Fields

필드타입설명
namestring닉네임
uuidstringUUID

Example Request

GET https://api.planetearth.kr/resident/list

GET /resident/bulk

모든 주민의 전체 정보를 반환합니다.
online 필드는 포함되지 않습니다.

Bulk Endpoint — 15분당 5회 제한

Example Request

GET https://api.planetearth.kr/resident/bulk

디스코드

GET /discord

디스코드 ID, UUID, 또는 닉네임으로 마인크래프트 ↔ 디스코드 연동 정보를 조회합니다.
name 파라메터 사용 시 Mojang API를 통해 UUID로 변환합니다.

Query Parameters

파라메터타입설명
discordstring디스코드 ID
uuidstring마인크래프트 UUID
namestring마인크래프트 닉네임

파라메터는 하나만 입력해야 합니다.

Response Fields

필드타입설명
discordstring디스코드 ID
uuidstring마인크래프트 UUID
namestring마인크래프트 닉네임

Example Request

GET https://api.planetearth.kr/discord?name=Irochi_

Example Response

{
"status": "SUCCESS",
"data": [
{
"discord": "1086117494189723658",
"uuid": "626dfe3b-7820-48c7-9974-1e332b4ffe60",
"name": "Irochi_"
}
]
}

거래소

GET /auction

닉네임, UUID, 또는 경매 ID로 현재 등록된 유저 거래소 아이템을 조회합니다.

Query Parameters

파라메터타입설명
namestring판매자 닉네임
uuidstring판매자 UUID
idstring아이템 UUID

파라메터는 하나만 입력해야 합니다.

Response Fields

필드타입설명
idstring아이템 UUID
sellerstring판매자 UUID
sellerNamestring판매자 닉네임
pricenumber판매가
expire_atstring경매 만료 일시
itemInfo.typestring아이템 종류 (예: minecraft:diamond_sword)
itemInfo.amountnumber수량
itemInfo.displayNamestring | null이름 (없을 경우 null)
itemInfo.lorestring[]설명 줄 목록
itemInfo.enchantsobject[]인첸트 목록 ({ id, level })

Example Request

GET https://api.planetearth.kr/auction?name=Steve

Example Response

{
"status": "SUCCESS",
"data": [
{
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"seller": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"sellerName": "Steve",
"price": 5000,
"expire_at": "2024-12-31T23:59:59.000Z",
"itemInfo": {
"type": "minecraft:diamond_sword",
"amount": 1,
"displayName": "전설의 검",
"lore": ["강력한 힘이 깃든 검"],
"enchants": [
{ "id": "minecraft:sharpness", "level": 5 },
{ "id": "minecraft:unbreaking", "level": 3 }
]
}
}
]
}

GET /auction/list

현재 거래소에 있는 모든 아이템을 반환합니다. 만료 일시 기준 오름차순 정렬.

Bulk Endpoint — 15분당 5회 제한

Example Request

GET https://api.planetearth.kr/auction/list

GET /auction/transactions/list

최근 거래소 거래 내역 100건을 최신 순으로 반환합니다.

Bulk Endpoint — 15분당 5회 제한

Response Fields

필드타입설명
idstring거래 ID
pricenumber거래 금액
transaction_datestring거래 일시
itemInfoobject아이템 정보 (/auction과 동일 구조)

Example Request

GET https://api.planetearth.kr/auction/transactions/list

Example Response

{
"status": "SUCCESS",
"data": [
{
"id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"price": 5000,
"transaction_date": "2024-12-31T23:59:59.000Z",
"itemInfo": {
"type": "minecraft:diamond_sword",
"amount": 1,
"displayName": "전설의 검",
"lore": ["강력한 힘이 깃든 검"],
"enchants": [
{ "id": "minecraft:sharpness", "level": 5 }
]
}
}
]
}

온라인 플레이어

GET /online

현재 서버에 접속 중인 플레이어 목록을 반환합니다.

Example Request

GET https://api.planetearth.kr/online

Example Response

{
"status": "SUCCESS",
"data": {
"total": 57,
"players": [
"Heiz",
"Irochi_",
"Ago",
"Yellim",
"..."
]
}
}

활용 예시

디스코드 인증 봇 (Python)

!auth 명령어를 사용한 유저가 Dev_Island 마을 소속이면 역할을 지급하고 닉네임을 변경하는 예시입니다.

import discord
import requests

TOKEN = "" # 봇 토큰
ROLE_ID = "" # 지급할 역할 ID

intents = discord.Intents.all()
client = discord.Client(intents=intents)

@client.event
async def on_ready():
print(f"Logged in as {client.user}")

@client.event
async def on_message(message):
if message.author == client.user:
return

if not message.content.startswith("!auth"):
return

# 1. 디스코드 ID → 마인크래프트 UUID 조회
res = requests.get(f"https://api.planetearth.kr/discord?discord={message.author.id}").json()
if res["status"] != "SUCCESS":
await message.channel.send("플래닛어스 디스코드에 인증되지 않은 유저입니다.")
return

uuid = res["data"][0]["uuid"]

# 2. UUID → 주민 정보 조회
res = requests.get(f"https://api.planetearth.kr/resident?uuid={uuid}").json()
if res["status"] != "SUCCESS":
await message.channel.send("타우니 데이터를 가져올 수 없습니다.")
return

resident = res["data"][0]

# 3. 마을 확인 후 역할 지급
if resident["town"] != "Dev_Island":
await message.channel.send("Dev_Island 마을에 가입되지 않은 플레이어입니다.")
return

guild = message.guild
role = discord.utils.get(guild.roles, id=int(ROLE_ID))
await message.author.add_roles(role)
await message.author.edit(nick=resident["name"])
await message.channel.send("인증에 성공했습니다! 권한을 지급합니다.")

client.run(TOKEN)