JavaScript client for ausdata.io

Modern JavaScript runtimes ship with fetch. The API is plain JSON with one bearer header, so a tiny wrapper around fetch covers every endpoint. Run it server-side to keep the key out of the browser.

No npm package yet. The fetch wrapper above is the canonical client.

Canonical client

JavaScript
const KEY = process.env.AUSDATA_KEY;
const BASE = "https://api.ausdata.io";

export async function ausdata(path, params = {}) {
  const url = new URL(BASE + path);
  for (const [k, v] of Object.entries(params)) url.searchParams.set(k, v);
  const r = await fetch(url, { headers: { Authorization: `Bearer ${KEY}` } });
  if (!r.ok) throw new Error(`ausdata ${r.status}`);
  return r.json();
}

Use it

JavaScript
const snap = await ausdata("/v1/economic-dashboard");
console.log(snap.data.cash_rate);

Notes

  • .Run this from your server or an edge function. Never ship the key to the browser.
  • .Bun, Deno, Cloudflare Workers, and Node 18+ all support fetch natively.
  • .Responses use a flat data object and a sources array with provenance.

Other SDKs

Get a key and call your first endpoint

500 free calls per month. No credit card.

Get a free API key