For developers

No-install SDK

There is no package to install. This is a tiny, copy-paste fetch helper for consuming Warconomy's static dataset in TypeScript or JavaScript: one function to fetch and type a resource, with version pinning. No dependencies, no runtime API. Not real-time.

static reference · data June 5, 2026

There is no npm package — and you don't need one. Copy the small helper below into your project. It wraps fetch with typing and version pinning over the static endpoints. No dependencies, no auth, no runtime API.

  • Zero dependencies; copy-paste.
  • Version pinning built in.
  • Pair with the published TypeScript declarations.

The helper

// warconomy.ts — a zero-dependency helper. Copy into your project.
const BASE = "https://warconomy.com";
const DATASET = "/datasets/conflict-economic-impact";

export async function fetchJson<T>(path: string): Promise<T> {
  const res = await fetch(BASE + path, { headers: { accept: "application/json" } });
  if (!res.ok) throw new Error(`Warconomy fetch failed: ${path} (${res.status})`);
  return (await res.json()) as T;
}

export const warconomy = {
  dataset: () => fetchJson(`${DATASET}/data.json`),
  graph: () => fetchJson(`${DATASET}/graph.json`),
  provenance: () => fetchJson(`${DATASET}/provenance.json`),
  checksums: () => fetchJson(`${DATASET}/checksums.json`),
  versions: () => fetchJson(`${DATASET}/versions/data.json`),
  // Pin a frozen version for reproducibility:
  versioned: (v: string) => fetchJson(`${DATASET}/versions/${v}/data.json`),
};

Usage

import { warconomy } from "./warconomy";

const data = await warconomy.dataset();
const live = data.observations.filter((o) => o.dataMode === "live");
// cite live values only; sample rows are illustrative

More

Types: /developers/types · declarations: types.d.ts · cookbook: /developers/cookbook.

Related Warconomy pages