Skip to main content
The client.location resource lets you look up where any entity currently is in the Star Wars Combine galaxy. Whether you need to find a ship, track a character’s position, or determine which system a vehicle is in, location.get() returns the full positional data for that entity. You provide the entity’s type and UID, and the API returns the location context including system, planet, and coordinate data.

Getting an entity’s location

location.get()

Returns the current location data for a single entity.
entityType
string
required
The type of entity to locate. Common values include:
  • character — a player character
  • ship — a spacecraft
  • vehicle — a ground vehicle
Other entity types may also be supported.
uid
string
required
The entity UID in "type:id" format, e.g. "1:12345" for a character.
// Get a character's current location
const location = await client.location.get({
  entityType: 'character',
  uid: '1:12345',
});

console.log(location.system);
console.log(location.planet);
console.log(location.x, location.y); // Coordinates
// Get a ship's current location
const shipLocation = await client.location.get({
  entityType: 'ship',
  uid: '8:67890',
});

console.log(shipLocation.system);
console.log(shipLocation.coordinates);

Common entity types

entityType valueDescription
characterPlayer character
shipSpacecraft
vehicleGround or repulsorlift vehicle
The entityType string here corresponds to the kind of entity you are locating, not the type-prefix in the UID. For example, a character with UID "1:12345" uses entityType: 'character'.

Full example

import { SWCombine } from 'swcombine-sdk';

const client = new SWCombine({ token: process.env.SWC_ACCESS_TOKEN! });

// Find where the authenticated character is
const me = await client.character.me();

const location = await client.location.get({
  entityType: 'character',
  uid: me.uid,
});

console.log(`Current location: ${location.system}`);

// Find where each of the character's ships is
const ships = await client.inventory.entities.list({
  uid: me.uid,
  entityType: 'ships',
  assignType: 'owner',
});

for await (const ship of ships) {
  const loc = await client.location.get({
    entityType: 'ship',
    uid: ship.uid,
  });
  console.log(`${ship.name} is in ${loc.system}`);
}
Calling location.get() for every ship in a large inventory will consume one API request per ship. If you have many ships, you may hit the 600 requests/hour rate limit. Consider caching location data or batching your lookups with a delay.

Galaxy

Browse systems, planets, and sectors to understand the galaxy map.

Inventory

List the ships and vehicles you want to locate.

Character

Get the character UID needed to look up a character’s location.

Rate limits

Understand the 600 req/hour quota before making per-entity location calls.