A REST API providing info about people, places and more on CCNetMC. This is a "fork" of the EarthMC API, and 99% of the code is not written by me. Although not actually a fork, I still update from upstream when possible (I barely know any JavaScipt, and what I do know was learnt from this project). The original API was created by Owen3H and Warriorrrr.
The original source code can be found here: https://github.com/Owen3H/EarthMC-API
- Install a fetch package in your chosen language.
$ npm install ccnetmc
- Require/import the package.
var fetch = require("node-fetch")
- Implement by fetching and returning the data.
var town = await fetch("https://shadowevil015.tech/api/v1/towns/new_amsterdam").then(res => res.json()).catch(err => { return err })
console.log(town)
// => {"name":"New_Amsterdam","nation":"Oceanic_Empire","residents":["ShootingRice","Shadowevil015","PinkyBleu"],"area":322,"mayor":"ShootingRice","capital":true,"x":18200,"z":3984,"bank":"$10,367.50","upkeep":"$320"}
- • https://shadowevil015.tech/api/v1
- Full URL Example: https://shadowevil015.tech/api/v1/towns
- Start with the base domain -
- Append a route from the list below
Nations
All - nations/
Single - [nations/nationName]https://shadowevil015.tech/api/v1/nations/Britain)
Players
This merges online players and residents.
NOTE - The "town", "nation" and "rank" keys will not appear for townless players
All - allplayers/
Single - allplayers/playerName
Nearby
Returns any players visible on the map in a radius to a certain point.
xPos/zPos - The coordinates of a point on the dynmap.
xRadius/zRadius - The x and z radii (in blocks) around the specified coords.