Skip to main content
The client.inventory resource gives you visibility into everything a character owns or is assigned to in the Star Wars Combine universe. You start with an overview that summarizes total counts by category, then drill down into individual entity types to page through the actual assets. The entities endpoint supports filtering by assignment type — owner, pilot, crewmember, and more — so you can answer questions like “which ships am I piloting but don’t own?”

Overview

inventory.get()

Returns a summary of all entities in a character’s inventory, grouped by type and assignment role.
uid
string
required
The character UID in "type:id" format, e.g. "1:12345".
const overview = await client.inventory.get({ uid: '1:12345' });

console.log(overview.ships.owned);
console.log(overview.items.total);

Listing entities

inventory.entities.list()

Returns a paginated list of entities of a specific type in the character’s inventory. Use entityType to select the category and assignType to filter by assignment role.
uid
string
required
The character UID.
entityType
string
required
The category of entities to list. Must be one of: ships, vehicles, stations, cities, facilities, planets, items, npcs, droids, creatures, materials.
assignType
string
Filter by assignment role. Common values: owner, pilot, crewmember. Omit to return all assignments.
start_index
number
default:"1"
1-based index of the first entity to return.
item_count
number
default:"50"
Number of entities per page.
// List all ships in the inventory
const ships = await client.inventory.entities.list({
  uid: '1:12345',
  entityType: 'ships',
});

console.log(ships.total); // Total ship count

for await (const ship of ships) {
  console.log(ship.name, ship.uid, ship.type);
}

Filtering by assignment type

The assignType parameter lets you distinguish between entities you own and entities you are assigned to in another role. This is particularly useful for ships and vehicles where a character may be a pilot or crewmember without being the owner.
// Ships this character owns
const ownedShips = await client.inventory.entities.list({
  uid: '1:12345',
  entityType: 'ships',
  assignType: 'owner',
});

// Ships this character is piloting but may not own
const pilotedShips = await client.inventory.entities.list({
  uid: '1:12345',
  entityType: 'ships',
  assignType: 'pilot',
});

All entity types

The entityType parameter accepts the following values:
ValueDescription
shipsSpacecraft of all classes
vehiclesGround and repulsorlift vehicles
stationsSpace stations
citiesPlanetary cities
facilitiesGround-based production and military facilities
planetsPlanets owned or controlled by the character
itemsEquipment, weapons, and consumables
npcsNon-player characters assigned to the character
droidsDroid units
creaturesDomesticated or working creatures
materialsRaw materials and resources

Full example

import { SWCombine } from 'swcombine-sdk';

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

const uid = '1:12345';

// Get the summary first
const overview = await client.inventory.get({ uid });

// Then page through ships
const ships = await client.inventory.entities.list({
  uid,
  entityType: 'ships',
  assignType: 'owner',
  item_count: 100,
});

console.log(`Owns ${ships.total} ships`);

for await (const ship of ships) {
  console.log(`  ${ship.name} (${ship.uid})`);
}

// List all items
const items = await client.inventory.entities.list({ uid, entityType: 'items' });
console.log(`${items.total} items in inventory`);
Large inventories — especially for items and materials — can span many pages. Use a higher item_count value and consider a pageDelay when auto-paginating to stay within rate limits.

Character

Fetch character profiles and credit balances.

Location

Look up where a specific ship or vehicle is currently located.

Types

Retrieve entity type definitions for ships, vehicles, and items.

Pagination

Learn how Page<T> works and how to auto-paginate.