Skip to main content
The client.faction resource exposes the faction layer of the Star Wars Combine economy and organization system. Factions are the primary organizational unit in the game — governments, corporations, crime syndicates, and more. You can list all factions, retrieve a specific one by UID, browse membership, inspect financial budgets, query stockholders, and page through the full credit transaction history for any faction.

Listing factions

faction.list()

Returns a paginated list of all factions in the game.
const factions = await client.faction.list();

console.log(factions.total);   // Total number of factions
console.log(factions.data[0]); // First FactionListItem

for await (const faction of factions) {
  console.log(faction.name, faction.uid);
}
uid
string
The faction’s unique identifier in "type:id" format, e.g. "20:123".
name
string
The faction’s display name.

Getting a single faction

faction.get()

Retrieves full details for a faction by UID.
uid
string
required
The faction UID in "type:id" format, e.g. "20:123".
const faction = await client.faction.get({ uid: '20:123' });

console.log(faction.name);
console.log(faction.credits);
console.log(faction.leader);
Faction UIDs use type prefix 20, e.g. "20:123". Character UIDs use type prefix 1, e.g. "1:12345". Always use the correct prefix for the resource type you are querying.

Members

faction.members.list()

Returns a paginated list of characters who are members of the faction.
uid
string
required
The faction UID.
start_index
number
default:"1"
1-based index of the first member to return.
item_count
number
default:"50"
Number of members per page.
const members = await client.faction.members.list({ uid: '20:123' });

console.log(members.total); // Total member count

for await (const member of members) {
  console.log(member.name, member.uid, member.rank);
}

Budgets

faction.budgets.list()

Returns all budget allocations for the faction. Budgets are returned as a flat array rather than a paginated result.
uid
string
required
The faction UID.
const budgets = await client.faction.budgets.list({ uid: '20:123' });

for (const budget of budgets) {
  console.log(budget.name, budget.allocated, budget.spent);
}
budgets.list() returns a plain FactionBudget[] array, not a Page<T>. There is no pagination — all budgets are returned in a single response.

Stockholders

faction.stockholders.list()

Returns a paginated list of stockholders in the faction, ordered by share count.
uid
string
required
The faction UID.
start_index
number
default:"1"
1-based index of the first stockholder to return.
item_count
number
default:"50"
Number of stockholders per page.
const stockholders = await client.faction.stockholders.list({ uid: '20:123' });

for await (const holder of stockholders) {
  console.log(holder.name, holder.shares);
}

Credit log

faction.creditlog.list()

Returns a paginated history of credit transactions for the faction.
uid
string
required
The faction UID.
start_index
number
default:"1"
1-based index of the first log entry to return.
item_count
number
default:"50"
Number of entries per page.
const creditLog = await client.faction.creditlog.list({ uid: '20:123' });

for await (const entry of creditLog) {
  console.log(entry.amount, entry.description, entry.timestamp);
}
The credit log can be very large for active factions. Use item_count to control page size and consider adding a pageDelay when auto-paginating to avoid hitting the 600 requests/hour rate limit.

Full example

import { SWCombine } from 'swcombine-sdk';

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

// Find a faction and inspect it
const factions = await client.faction.list();
const first = factions.data[0];

const faction = await client.faction.get({ uid: first.uid });
console.log(`${faction.name} has ${faction.credits} credits`);

// List its members
const members = await client.faction.members.list({ uid: first.uid });
console.log(`${members.total} total members`);

// Inspect budgets
const budgets = await client.faction.budgets.list({ uid: first.uid });
budgets.forEach(b => console.log(b.name, b.allocated));

Character

Look up individual characters and their faction privileges.

Datacard

List production datacards licensed to a faction.

Events

Query the event log filtered by faction activity.

Pagination

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