Difference between revisions of "WebAPI:Galaxies"

From Starsonata Wiki
Jump to: navigation, search
(Example)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
This returns a list of all [[Galaxy|galaxies]] in the game that have been discovered or otherwise marked as public knowledge.
+
This returns a list of all [[Galaxy|galaxies]] in the game that have been discovered or otherwise marked as public knowledge. Galaxies will show up 24h after their initial in-game discovery, unless they are located in W0 space (in which case they will show up immediately).
 +
 
 +
==Parameters==
 +
<code>https://www.starsonata.com/webapi/galaxies/v1</code>
 +
 
 +
No parameters.
  
 
==Response==
 
==Response==
Line 10: Line 15:
 
* <code>links</code> - An array of galaxy IDs that this galaxy has wormholes leading to.
 
* <code>links</code> - An array of galaxy IDs that this galaxy has wormholes leading to.
 
* <code>layer</code> - The layer of the map that this galaxy resides in.
 
* <code>layer</code> - The layer of the map that this galaxy resides in.
 +
* <code>df</code> - The df of the map that this galaxy resides in. This is on a slightly different scale and is 1/10th of the value you normally see in-game.
 +
* <code>special</code> - true if the galaxy is marked as "special".
 +
* <code>anchor</code> - true if the galaxy is marked as an anchor. This means that the map should render it in its own layer as well as layers of galaxies that it is linked to.
 +
* <code>owningTeamID</code> - The team ID of a Userteam that owns the galaxy. Use the [[WebAPI:teams|teams]] api to get more details on the team.
 +
* <code>owningTeam</code> - The name of an ai team that owns the galaxy. Mutually exclusive with owningTeamID.
 +
* <code>protected</code> - true if the galaxy is protected by the team that owns it.
 +
* <code>aibases</code> - The number of aibases in the galaxy.
 +
* <code>userbases</code> - The number of userbasesin the galaxy.
 +
* <code>mapable</code> - false if the galaxy is not rendered on the normal map
  
 +
The above values are trimmed if they are an empty string or false, with the exception of mapable which is trimmed if it is true.
 
==Example==
 
==Example==
 +
A couple galaxies as they would appear in the galaxies array.
 +
 +
<pre>
 +
{
 +
"32812": {
 +
"ID": 32812,
 +
"name": "Rigel",
 +
"lastUpdate": 1618234241,
 +
"x": 1.14028,
 +
"y": 1.39111,
 +
"links": [32858, 32836, 33086, 53850],
 +
"layer": 0,
 +
"df": 0.6,
 +
"aibases": 1,
 +
"userbases": 3
 +
},
 +
"32818": {
 +
"ID": 32818,
 +
"name": "Vulpis Plethoris",
 +
"lastUpdate": 1618219811,
 +
"x": 0.946635,
 +
"y": 0.462609,
 +
"links": [32786, 32824, 32776, 52647, 53184, 90171],
 +
"layer": 0,
 +
"df": 0.1,
 +
"aibases": 3,
 +
"userbases": 8
 +
}
 +
}
 +
</pre>
 +
 +
==See Also==
 +
*[[WebAPI:galaxies_recent|galaxies_recent]]
 +
 +
 +
[[Category:WebAPI]]

Latest revision as of 08:38, 12 April 2021

This returns a list of all galaxies in the game that have been discovered or otherwise marked as public knowledge. Galaxies will show up 24h after their initial in-game discovery, unless they are located in W0 space (in which case they will show up immediately).

Parameters

https://www.starsonata.com/webapi/galaxies/v1

No parameters.

Response

Returns an array galaxies with members keyed by their galaxy ID. Each galaxy has the following attributes.

  • ID - The galaxy ID. This is unique per galaxy in a universe.
  • name - The galaxy name.
  • lastUpdate - The last time the galaxy was updated in the api.
  • x - The x coordinate for the map.
  • y - The y coordinate for the map.
  • links - An array of galaxy IDs that this galaxy has wormholes leading to.
  • layer - The layer of the map that this galaxy resides in.
  • df - The df of the map that this galaxy resides in. This is on a slightly different scale and is 1/10th of the value you normally see in-game.
  • special - true if the galaxy is marked as "special".
  • anchor - true if the galaxy is marked as an anchor. This means that the map should render it in its own layer as well as layers of galaxies that it is linked to.
  • owningTeamID - The team ID of a Userteam that owns the galaxy. Use the teams api to get more details on the team.
  • owningTeam - The name of an ai team that owns the galaxy. Mutually exclusive with owningTeamID.
  • protected - true if the galaxy is protected by the team that owns it.
  • aibases - The number of aibases in the galaxy.
  • userbases - The number of userbasesin the galaxy.
  • mapable - false if the galaxy is not rendered on the normal map

The above values are trimmed if they are an empty string or false, with the exception of mapable which is trimmed if it is true.

Example

A couple galaxies as they would appear in the galaxies array.

{
	"32812": {
		"ID": 32812,
		"name": "Rigel",
		"lastUpdate": 1618234241,
		"x": 1.14028,
		"y": 1.39111,
		"links": [32858, 32836, 33086, 53850],
		"layer": 0,
		"df": 0.6,
		"aibases": 1,
		"userbases": 3
	},
	"32818": {
		"ID": 32818,
		"name": "Vulpis Plethoris",
		"lastUpdate": 1618219811,
		"x": 0.946635,
		"y": 0.462609,
		"links": [32786, 32824, 32776, 52647, 53184, 90171],
		"layer": 0,
		"df": 0.1,
		"aibases": 3,
		"userbases": 8
	}
}

See Also