Skip to content
Documentation Menu

Using the Package

Entities

The dataset currently holds 152 entities. Each entity is a structured record with brand metadata, logos, financial identifiers, and category tags. All accessors return plain data — no classes, no wrappers.

getEntity

Look up a single entity by its id. Returns undefined for an unknown id.

function getEntity(id: string): Entity | undefined
import { getEntity } from '@finmarks/finmarks';

const hdfc = getEntity('hdfc-bank');

hdfc?.name;          // 'HDFC Bank'
hdfc?.brand_color;   // '#004C8F'
hdfc?.ifsc_prefix;   // 'HDFC'
hdfc?.categories;   // ['private-bank', 'upi-psp']

mustGetEntity

Like getEntity but throws when the id is unknown. Use this when a missing entity means a bug in your code rather than an expected case — it saves optional chaining on a value you know exists.

function mustGetEntity(id: string): Entity
import { mustGetEntity } from '@finmarks/finmarks';

const paytm = mustGetEntity('paytm');  // throws if not found
paytm.name;  // 'Paytm' — no ?. needed

hasEntity

Returns true if an entity with this id exists in the dataset.

function hasEntity(id: string): boolean
import { hasEntity } from '@finmarks/finmarks';

hasEntity('phonepe');    // true
hasEntity('not-real');  // false

getAllEntities

Returns every entity in the dataset. Pass { includeInactive: false } to drop entities with a status other than 'active'.

function getAllEntities(options?: FilterOptions): Entity[]
import { getAllEntities } from '@finmarks/finmarks';

// All entities, including defunct and acquired
getAllEntities();

// Active entities only
getAllEntities({ includeInactive: false });

getAllEntityIds

Returns every entity id, in dataset order.

function getAllEntityIds(): string[]
import { getAllEntityIds } from '@finmarks/finmarks';

const ids = getAllEntityIds();
// ['hdfc-bank', 'icici-bank', 'sbi', ...]

Entity status

Entities are not deleted when they are acquired or shut down — they stay in the dataset with an updated status, because old logos and identifiers still appear in real data.

StatusMeaning
activeOperating under its own brand
acquiredNo longer independent; acquired_by is set
defunctShut down
rebrandedOperating under a different name; acquired_by points at the successor