Skip to content

Node.js API surface

Everything exported by @xbbg/core.

This page maps the public Node.js package surface from js-xbbg/src/index.ts and js-xbbg/src/types.ts so the docs track the package published on npm.

Runtime and configuration

Engine

Direct engine class with new Engine(host, port) and Engine.withConfig(config).

connect / configure

Top-level connection helpers for process-wide usage.

EngineConfig

Host/port, ordered servers, ZFP, TLS, SOCKS5, auth, retry, worker pools, stream tuning, validation, field cache, keepalive, slow-consumer watermarks, SDK logging.

Native package resolution

The npm package loads a platform native addon through optional @xbbg/core-* packages.

Constants, helpers, and errors

  • Backend.ARROW
  • Backend.JSON
  • Backend.POLARS
  • Format.LONG
  • Format.LONG_TYPED
  • Format.LONG_WITH_METADATA
  • Format.SEMI_LONG
  • formatDate
  • formatDateTime
  • version
  • setLogLevel
  • getLogLevel

Error exports include BlpError, BlpSessionError, BlpRequestError, BlpValidationError, BlpTimeoutError, BlpInternalError, and wrapError.

Top-level request helpers

FamilyHelpers
Reference / historical / bulkbdp, abdp, bdh, abdh, bds, abds
Intradaybdib, abdib, bdtick, abdtick
Subscriptionssubscribe, asubscribe, Subscription, Tick, ArrowSubscription
Namespacesblp, ext

The top-level helpers use the configured engine. They are convenient for services that want one process-level runtime.

Engine methods

Engine exposes the full request and operational surface:

AreaMethods
Generic executionrequest, requestRaw
Core Bloomberg workflowsbdp, bds, bdh, bdib, bdtick, bql, beqs, bsrch, bta, bflds, blkp, bport, bcurves, bgovts
Field metadataresolveFieldTypes, getFieldInfo, clearFieldCache, saveFieldCache, validateFields, isFieldValidationEnabled
Schema introspectiongetSchema, getOperation, listOperations, getCachedSchema, invalidateSchema, clearSchemaCache, listCachedSchemas, getEnumValues, listValidElements, bops, bschema
Streaming servicessubscribe, subscribeWithOptions, stream, vwap, mktbar, depth, chains
LifecyclesignalShutdown, isAvailable

Recipe and analytics methods

AreaMethods
Fixed incomebqr, yas, preferreds, corporateBonds
Futures / CDX resolutionfutTicker, activeFutures, cdxTicker, activeCdx
Historical / holdingsdividend, turnover, etfHoldings
CurrencycurrencyConversion

blp namespace

The blp namespace exposes the common Bloomberg request helpers in an object shape:

ts
import { blp } from '@xbbg/core';

const snapshot = await blp.abdp(['AAPL US Equity'], ['PX_LAST']);
const history = await blp.abdh(['AAPL US Equity'], ['PX_LAST'], '2024-01-01', '2024-01-31');
const sub = await blp.asubscribe(['AAPL US Equity'], ['LAST_PRICE']);

Current blp keys include bdp, bdh, bds, bdib, bdtick, subscribe, abdp, abdh, abds, abdib, abdtick, and asubscribe.

ext namespace

The ext namespace exposes lower-level helpers and native utility functions for recipes and market metadata:

  • CDX helpers: ext.cdx.acdx_info, ext.cdx.acdx_pricing, ext.cdx.acdx_risk
  • Date and format helpers: parseDate, fmtDate, pivotToWide, isLongFormat
  • Ticker and futures helpers: parseTicker, buildFuturesTicker, generateFuturesCandidates, validateGenericTicker, filterValidContracts
  • CDX ticker helpers: parseCdxTicker, previousCdxSeries, cdxGenToSpecific
  • Currency helpers: buildFxPair, sameCurrency, currenciesNeedingConversion
  • Historical and holdings helpers: renameDividendColumns, renameEtfColumns, getDvdTypes, getDvdCols, getEtfCols
  • Fixed-income query helpers: buildYasOverrides, buildPreferredsQuery, buildCorporateBondsQuery
  • Market/session helpers: deriveSessions, getMarketRule, inferTimezone, exchange override helpers, sessionTimesToUtc

Public TypeScript types

The package exports typed inputs for every public surface, including DateLike, DateTimeLike, EngineConfig, RequestInput, StreamOptions, BdpOptions, BdhOptions, BdibOptions, BdtickOptions, BqlOptions, BeqsOptions, BsrchOptions, BtaOptions, BfldsOptions, BqrOptions, YasOptions, PreferredsOptions, CorporateBondsOptions, FuturesResolveOptions, ActiveCdxOptions, DividendOptions, TurnoverOptions, EtfHoldingsOptions, RetryPolicy, TlsConfig, Socks5Config, and result metadata interfaces such as SubscriptionStats, FieldInfo, ExchangeInfoResult, and SessionWindowsInfo.

Backend notes

  • Backend.ARROW returns Apache Arrow tables.
  • Backend.JSON returns JavaScript-friendly objects.
  • Backend.POLARS requires the optional nodejs-polars peer dependency.
  • DateLike accepts Date, ISO/Bloomberg-native strings, epoch milliseconds, or duck-typed Luxon DateTime values with toJSDate().

xbbg is independent open-source software and is not affiliated with, endorsed by, sponsored by, or approved by Bloomberg Finance L.P.