Skip to content

API specifications

Smyler edited this page Mar 5, 2021 · 3 revisions

About the API and this doc

The API always takes its arguments (if any) as GET parameters and sends back the result in the response's body as a JSON object. Various endpoints offer various functionalities and often have subdivisions. By convention, all paths will be given from the root of the web address.

Endpoints

/info

Available since 0.0.2
Returns information about the API instance in use.
E.G. https://smybteapi.thesmyler.fr/info ->

{
   "software-version": "1.0.9",
   "software-license": "MIT License",
   "software-credit": "SmylerMC \u003csmyler@mail.com\u003e",
   "software-repo": "https://github.com/SmylerMC/smyler-bte-api",
   "instance-name": "Main SmyBTE API instance at smybteapi.thesmyler.fr",
   "instance-administrator": "SmylerMC \u003csmyler@mail.com\u003e",
   "instance-info": "Ask for information on the BTE development hub discord",
   "host":"smybteapi.thesmyler.fr",
   "client":"88.164.41.70",
   "user-agent":"Mozilla/5.0 (X11; Linux x86_64; rv:75.0) Gecko/20100101 Firefox/75.0"
}

/projection

This endpoints is subdivided and offers functionalities related to the Terra++ projections.

/projection/toGeo

Available since 0.0.7
Converts Minecraft coordinates to latitude and longitude.
Parameters:

  • mcpos (can be present multiple times) Position in the Minecraft world, formatted as {x},{z} where x and z are 64 bits floating points values

Returns:

  • mc_positions a list containing one entry for each time mcpos was specified in the request. Each entry is either a list containing two 64 bits floating points values, the first one being latitude and the second one being longitude, or null if the specified point was out the projection's bounds.
  • total an integer counting the number of time mcpos was specified in the rsuccess an integer counting the number of point which were successfully projected.
  • out_of_bounds an integer counting the number of point which were out of the projection's bounds and were not projected.

E.G. https://smybteapi.thesmyler.fr/projection/toGeo?mcpos=2851824,-5050670&mcpos=11571988,-6472387&mcpos=10000000000000,-1000000000 ->

{
   "geo_positions": [
      [48.86471138417888, 2.3490083011787912],
      [39.907499316999925, 116.39722635370677],
      null
   ],
   "total":3,
   "success":2,
   "out_of_bounds":1
}

/projection/fromGeo

Available since 0.0.7
Converts latitude and longitude to coordinates to latitude and longitude.
Parameters:

  • mcpos (can be present multiple times) Position in the Minecraft world, formatted as {x},{z} where x and z are 64 bits floating points values

Returns:

  • mc_positions a list containing one entry for each time mcpos was specified in the request. Each entry is either a list containing two 64 bits floating points values, the first one being latitude and the second one being longitude, or null if the specified point was out the projection's bounds.
  • total an integer counting the number of time mcpos was specified in the rsuccess an integer counting the number of point which were successfully projected.
  • out_of_bounds an integer counting the number of point which were out of the projection's bounds and were not projected.

E.G. https://smybteapi.thesmyler.fr/projection/toGeo?mcpos=2851824,-5050670&mcpos=11571988,-6472387&mcpos=10000000000000,-1000000000 ->

{
   "geo_positions": [
      [48.86471138417888, 2.3490083011787912],
      [39.907499316999925, 116.39722635370677],
      null
   ],
   "total":3,
   "success":2,
   "out_of_bounds":1
}

Clone this wiki locally