EarthPol - Towny JSON API

Towny JSON API



Client Responsibilities
Client MUST parse all data usin JSON.
Client MUST limit their requests to 20/requests a minute.

Failure to abide to these responsibilities will cause firewall rules and rate limits to be placed on your bot service

JSON data avaliable
-> Residents
Request URL: http://srv.earthpol.com/api/json/residents.php
Request Resident: {request_url} + ?name={resident_username}
Example return:
{
"MrAwsomeBurgers": {
"town": "London",
"town-rank": "",
"nation-ranks": "",
"lastOnline": "1608268662638",
"registered": "1605909955942",
"title": "",
"surname": "",
"friends": "",
"uuid": "637f0522-5250-402e-ac66-305a7e6d2c76"}
}



-> Towns
Request URL: http://srv.earthpol.com/api/json/towns.php
Request Town: {request_url} + ?name={townname}
Example return:
{
"Kyoto": {
"mayor": "KawadaJP",
"nation": "Japan",
"assistants": "GrimOmen#IJustGotKarma#KawadaJP#oAdeline#Taima_",
"townBoard": "/town set board [msg]",
"tag": "",
"open": "0",
"public": "0",
"spawn": "Earth326#46383.08526474447#70.0#-11785.159710123591#25.49934#60.038086",
"outpostSpawns": "",
"outlaws": "",
"registered": "1605928358866"}
}


-> Nations
Request URL: http://srv.earthpol.com/api/json/nations.php
Request Nation: {request_url} + ?name={nation_name}
Example return:
{
"North_America": {
"capital": "Michiana",
"tag": "",
"allies": "Australia#California_Republic#Nova_Scotia",
"enemies": "Amazonian_Empire",
"registered": "1606017105124",
"nationBoard": "/nation set board [msg]",
"mapColorHexCode": "ffd700",
"nationSpawn": "Earth326#-29518.067044873085#68.0#-14370.633000316353#32.84994#-67.94214",
"isPublic": "0",
"isOpen": "0"}
}