Quickstart
Make your first reference, historical, intraday, and BQL requests.
Node.js installation
@xbbg/core.npm and Bun install the package together with the prebuilt native addon for your platform. The addon then loads Bloomberg's SDK runtime library from the same machine.
| Requirement | Details |
|---|---|
| Runtime | Node.js 24 or newer (engines.node is >=24) or Bun 1.4 or newer. Server runtimes only; there is no browser build. |
| Platform | Prebuilt addons for macOS arm64, Linux x64 (glibc 2.28 or newer), and Windows x64. |
| Bloomberg | Access through the Desktop API (a Terminal session), B-PIPE, SAPI, or ZFP, plus the Bloomberg C++ SDK runtime library on the same machine. |
npm install @xbbg/corebun add @xbbg/corePackage page: npm / @xbbg/core
| Package | Role |
|---|---|
@xbbg/core | The JavaScript entry point with TypeScript declarations. It is a CommonJS package that also works with import, including named imports, from ES modules and TypeScript. |
apache-arrow ^21.1.0 | Runtime dependency for result tables. Add it to your own package.json if you import its types. |
@xbbg/core-darwin-arm64, @xbbg/core-linux-x64, @xbbg/core-win32-x64 | Optional dependencies, one per platform, each holding the native addon. npm and Bun install only the one that matches your machine. |
nodejs-polars >=0.10.0 | Optional peer dependency. Install it yourself only if you use backend: 'polars'. |
# Only needed for backend: 'polars'
npm install nodejs-polarsImporting @xbbg/core loads the native addon immediately, and the addon needs Bloomberg's SDK runtime library: blpapi3_64.dll on Windows, libblpapi3_64.so on Linux, or libblpapi3.dylib on macOS. If the library cannot be found, the import itself throws; no request is needed to see the failure.
@xbbg/core puts the first directory that contains the runtime at the front of PATH. BLPAPI_LIB_DIR (the directory holding the library) is checked first, then BLPAPI_ROOT (an SDK root; its bin and lib folders are also checked), then the standard Bloomberg Terminal DAPI install directories. A Terminal installed in the default location needs no configuration.LD_LIBRARY_PATH on Linux.node -e "console.log(require('@xbbg/core').version())"This prints 1.8.0. It loads the native addon and the Bloomberg SDK runtime but opens no Bloomberg session; sessions start only when an engine is created.
import * as xbbg from '@xbbg/core';
console.log(xbbg.version()); // '1.8.0'
console.log(Object.keys(xbbg.blp)); // ['abdh', 'abdib', 'abdp', ...]With no configuration, @xbbg/core connects to a Desktop API session on localhost:8194. Pass an EngineConfig to connect() or configure() for B-PIPE hosts, failover, authorization, TLS, ZFP, or SOCKS5:
import { connect } from '@xbbg/core';
const engine = await connect({ host: 'localhost', port: 8194 });
console.log(engine.isAvailable()); // true when a request session is healthySee the Quickstart for first requests and Configuration for every connection setting.
There are no prebuilt addons for other targets, such as Linux arm64 or macOS x64. On those platforms the import fails with a message saying that no packaged native addon is available. Building the addon from source needs a checkout of the xbbg repository, Rust 1.88 or newer, and an authorized Bloomberg C++ SDK; the repository documents the build.
Make your first reference, historical, intraday, and BQL requests.
Connect to B-PIPE, ZFP, or proxied endpoints and tune the engine.
Choose between xbbg, @xbbg/core, and the agent adapters.
Browse the generated TypeScript reference.