+ Getting Started with the API
+
+ To use the My-MC.Link API, you need an API key. Generate one by running /api-key
in our server. The key, valid for 365 days, will be sent to your Direct Messages.
+
+ API URL: https://api.my-mc.link
+ Include the authentication header x-my-mc-auth
with your token in all requests.
+
+ The examples below use UniRest for JavaScript. New methods will be added over time, so check back regularly. +
++ API Endpoints
+GET /hello
+Test the API and verify the authenticated user.
+var unirest = require('unirest');
+
+unirest
+ .get('https://api.my-mc.link/hello')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{ success: true, message: 'Hello, mc_342128351638585344!' }
+ GET /time
+Check the expiration time of your API key.
+var unirest = require('unirest');
+
+unirest
+ .get('https://api.my-mc.link/time')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{
+ success: true,
+ keyexpireString: 'Tue Apr 15 2025 06:14:59 GMT-0400 (Eastern Daylight Time)',
+ expireDate: '2025-04-15T10:14:59.000Z',
+ expireEpoch: 1744712099000
+}
+ GET /stats
+Retrieve statistics for your Minecraft server.
+var unirest = require('unirest');
+
+unirest
+ .get('https://api.my-mc.link/stats')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{
+ success: true,
+ stats: {
+ serverName: 'mc_342128351638585344',
+ memory: { raw: '185MiB / 4GiB', percent: '4.52%' },
+ cpu: '317.98%'
+ }
+}
+ GET /log
+Get the URL for your server’s live log.
+var unirest = require('unirest');
+
+unirest
+ .get('https://api.my-mc.link/log')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{
+ success: true,
+ message: 'https://logs.my-mc.link/container/3a48afc921c6'
+}
+ GET /start
+Start your server container.
+var unirest = require('unirest');
+
+unirest
+ .get('https://api.my-mc.link/start')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{ success: true, message: 'Started', completed: 'OK' }
+ GET /stop
+Stop your server container.
+var unirest = require('unirest');
+
+unirest
+ .get('https://api.my-mc.link/stop')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{ success: true, message: 'Stopped', completed: 'OK' }
+ GET /restart
+Restart your server container.
+var unirest = require('unirest');
+
+unirest
+ .get('https://api.my-mc.link/restart')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{ success: true, message: 'Restarted', completed: 'OK' }
+ GET /my-link
+Generate or retrieve your server’s connection link.
+var unirest = require('unirest');
+
+unirest
+ .get('https://api.my-mc.link/my-link')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{
+ success: true,
+ action: 'New-Link',
+ message: 'Success!',
+ hostname: 'my-mc.link',
+ port: 40129
+}
+ GET /my-geyser-link
+Generate or retrieve the Geyser UDP connection link.
+var unirest = require('unirest');
+
+unirest
+ .get('https://api.my-mc.link/my-geyser-link')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{
+ success: true,
+ action: 'New-Geyser-Link',
+ message: 'Geyser connection established successfully!',
+ hostname: 'my-mc.link',
+ port: 35633
+}
+ GET /my-sftp
+Generate or retrieve the SFTP connection details.
+var unirest = require('unirest');
+
+unirest
+ .get('https://api.my-mc.link/my-sftp')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{
+ success: true,
+ action: 'New-Link',
+ message: 'Success!',
+ hostname: 'sftp://my-mc.link',
+ port: 34149,
+ user: 'mc',
+ password: 'Fyuak12tq0NcuvcQ'
+}
+ GET /my-hash
+Retrieve the P2P hash for your server container.
+var unirest = require('unirest');
+
+unirest
+ .get('https://api.my-mc.link/my-hash')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{
+ success: true,
+ action: 'getConnectionHash',
+ message: '9b63a54507d4473350cec0ce34c4e6f9ass3657887e659a7efd341e32100c15e'
+}
+ GET /my-geyser-hash
+Retrieve the P2P hash for Geyser connections.
+var unirest = require('unirest');
+
+unirest
+ .get('https://api.my-mc.link/my-geyser-hash')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{
+ success: true,
+ action: 'getConnectionHashGeyser',
+ message: 'hs://s0006fbd2c4d48a4cef8df3417deec0194888d115672fb12bdaf91d61dd4ee0087d1'
+}
+ GET /my-sftp-hash
+Retrieve the P2P hash for SFTP connections.
+var unirest = require('unirest');
+
+unirest
+ .get('https://api.my-mc.link/my-sftp-hash')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{
+ success: true,
+ action: 'getConnectionHashSFTP',
+ message: '1832805e6dd13d61572c6cb1egg7f071acc65507c5df9f78a7a6ae39ae6f206'
+}
+ GET /list-players
+Get information about players connected to the server.
+var unirest = require('unirest');
+
+unirest
+ .get('https://api.my-mc.link/list-players')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{
+ success: true,
+ message: 'On mc_342128351638585344 there are 1 of a max of 20 players.',
+ players: [ ' snxravenmc' ]
+}
+ GET /website
+Retrieve your server’s website URL.
+var unirest = require('unirest');
+
+unirest
+ .get('https://api.my-mc.link/website')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{
+ success: true,
+ title: 'Website',
+ message: 'https://smjdmfqkl25kw6mdkveqqu6hddbyv4hkroojuxfuv7k6iwptz2bq.my-mc.link'
+}
+ GET /map
+Retrieve your server’s BlueMap URL.
+var unirest = require('unirest');
+
+unirest
+ .get('https://api.my-mc.link/map')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{
+ success: true,
+ title: 'BlueMap',
+ message: 'https://sf5bk42u6y32wsvifa3rvowioowfsypem3qrebjfaxs5vi5z3asa.my-mc.link'
+}
+ POST /ban
+Ban a user by their username.
+Payload:
+{"username": "snxravenmc"}
+
+ var unirest = require('unirest');
+
+unirest
+ .post('https://api.my-mc.link/ban')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .send({"username": "snxravenmc"})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{
+ success: true,
+ message: 'snxravenmc has been banned from mc_342128351638585344'
+}
+ POST /unban
+Unban a user by their username.
+Payload:
+{"username": "snxravenmc"}
+
+ var unirest = require('unirest');
+
+unirest
+ .post('https://api.my-mc.link/unban')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .send({"username": "snxravenmc"})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{
+ success: true,
+ message: 'snxravenmc has been unbanned from mc_342128351638585344'
+}
+ POST /say
+Send a global message to the server via RCON.
+Payload:
+{"message": "Hello There, This is a test!\nDid this work?"}
+
+ var unirest = require('unirest');
+
+unirest
+ .post('https://api.my-mc.link/say')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .send({"message": "Hello There, This is a test!\nDid this work?"})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{ success: true, message: 'Message Sent Successfully!' }
+ POST /tell
+Send a private message to a specific user via RCON.
+Payload:
+{"username": "snxravenmc","message": "hiiiii"}
+
+ var unirest = require('unirest');
+
+unirest
+ .post('https://api.my-mc.link/tell')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .send({"username": "snxravenmc","message": "hiiiii"})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{ success: true, message: 'Message Sent Successfully!' }
+ POST /console
+Send RCON commands to your server.
+Payload:
+{"command": "time set day"}
+
+ var unirest = require('unirest');
+
+unirest
+ .post('https://api.my-mc.link/console')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .send({"command": "time set day"})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{ success: true, message: 'Set the time to 1000' }
+ POST /give
+Give items to a specific user.
+Payload:
+{"username": "snxravenmc", item: "torch", amount: 1}
+
+ var unirest = require('unirest');
+
+unirest
+ .post('https://api.my-mc.link/give')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .send({"username": "snxravenmc", item: "torch", amount: 1})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{
+ success: true,
+ message: 'Gave snxravenmc 1 torch',
+ username: 'snxravenmc',
+ amount: 1,
+ item: 'torch'
+}
+ POST /install
+Install a mod using a Modrinth ID or keyword search.
+Payload:
+{"mod": "IDHERE"}
+
+ var unirest = require('unirest');
+
+unirest
+ .post('https://api.my-mc.link/install')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .send({"mod": "IDHERE"})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{
+ success: true,
+ message: 'Task Complete on mc_342128351638585344',
+ log: '- Searching for abooMhox...\n' +
+ '- Installing Tree Harvester...\n' +
+ '✔ Successfully installed Tree Harvester\n'
+}
+ POST /uninstall
+Uninstall a mod using a Modrinth ID or keyword search.
+Payload:
+{"mod": "IDHERE"}
+
+ var unirest = require('unirest');
+
+unirest
+ .post('https://api.my-mc.link/uninstall')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .send({"mod": "IDHERE"})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{
+ success: true,
+ message: 'Task Complete on mc_342128351638585344',
+ log: '- Uninstalling abooMhox...\n' +
+ '- Uninstalling abooMhox...\n' +
+ '✔ Tree Harvester successfully uninstalled!\n'
+}
+ POST /search
+Search for mods by keyword with compatibility checking.
+Payload:
+{"mod": "Tree","offset": 0}
+
+ var unirest = require('unirest');
+
+unirest
+ .post('https://api.my-mc.link/search')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .send({"mod": "Tree","offset": 0})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{
+ success: true,
+ message: 'Search Results',
+ limit: 10,
+ offset: 0,
+ totalHits: 23,
+ results: [
+ {
+ title: 'FallingTree',
+ description: 'Break down your trees by only cutting one piece of it',
+ server: 'required',
+ client: 'unsupported',
+ downloads: 894148,
+ installID: 'Fb4jn8m6'
+ },
+ ...
+ ]
+}
+ GET /mod-list
+List all mods installed on your server.
+var unirest = require('unirest');
+
+unirest
+ .get('https://api.my-mc.link/mod-list')
+ .headers({'Accept': 'application/json', 'Content-Type': 'application/json', 'x-my-mc-auth': 'TokenHere'})
+ .then((response) => {
+ console.log(response.body)
+ })
+
+ Response:
+{
+ success: true,
+ message: 'Mods listed for mc_342128351638585344',
+ mods: [
+ {
+ name: 'Adrenaserver',
+ id: 'H9OFWiay',
+ fileName: 'Adrenaserver-1.5.0+1.20.4.fabric.mrpack',
+ version: '1.5.0+1.20.4.fabric',
+ source: 'Modrinth',
+ essential: false,
+ dependencies: ''
+ },
+ ...
+ ]
+}
+ + Explore More
+
+ Ready to automate your server?
Join our community, dive into our resources, and start building with the My-MC.Link API.
+