API SDK
The API SDK is a cross-platform client library that wraps flat file access behind a navigable object graph, so you don't have to parse and cross-reference the raw JSON yourself. It's available for both JavaScript/TypeScript and .NET, with identical contracts on both sides.
Note
OTA (Seaware) API support is planned but not yet available — the SDK currently covers flat files only. Until then, use the Seaware API (SwOTA) directly for real-time pricing, holds, and bookings.
Source: github.com/TravelHX/api-sdk
What it does
- Loads voyages, ships, cabin grades, departures, and ports into an in-memory, bidirectionally-navigable object graph (
voyage.departures[0].ship.cabinGrades,cabinGrade.departures[0].voyage, …), instead of you resolving codes across files by hand. - Dormant until loaded — the factory returns an interface; nothing is read until you call
load/LoadAsync. - Interface-only surface — packages export the factory, interfaces, and entity types; concrete classes are hidden.
Install
JavaScript/TypeScript — npm package @api-sdk/js:
npm install @api-sdk/js
.NET — NuGet package ApiSdk.
Usage
JavaScript:
import { createApiSdk } from '@api-sdk/js';
const sdk = createApiSdk();
await sdk.load(sources);
sdk.departure(code).offeringForGrade('DS').priceFor('GBP').double;
.NET:
using ApiSdk;
var sdk = ApiSdkFactory.CreateApiSdk();
await sdk.LoadAsync(sources);
sdk.GetDeparture(code).OfferingForGrade("DS").PriceFor("GBP").Double;
sources is your loaded flat files (see Flat files for how to fetch them, V1 or V3).
Interactive CLI
Both implementations ship a terminal UI for browsing loaded data without writing code — useful for exploring the object graph or verifying a data load: configuration, test-file location, and a browsable voyages → departures → cabins view. See the repo README for launch instructions.
Further reading
The repo README covers build/test commands, project layout, and worked examples (utils/js/usageCase.js, utils/dotnet/ApiSdk.UsageCase) for both SDKs in full.