Load ausdata into DuckDB

Use httpfs to read the Parquet endpoint directly into DuckDB.

Steps

  1. 1INSTALL httpfs.
  2. 2SET the bearer token via http_headers.
  3. 3CREATE TABLE AS SELECT.

Code

cURL
curl https://api.ausdata.io/v1/data/abs/cpi.parquet \
  -H "Authorization: Bearer YOUR_KEY"
Python
import requests
r = requests.get(
    "https://api.ausdata.io/v1/data/abs/cpi.parquet",
    headers={"Authorization": "Bearer YOUR_KEY"},
)
print(r.json())
JavaScript
const r = await fetch("https://api.ausdata.io/v1/data/abs/cpi.parquet", {
  headers: { Authorization: "Bearer YOUR_KEY" },
});
console.log(await r.json());

Watch out for

  • DuckDB caches HTTP responses in memory. Restart between auth changes.

Related

Try it now

500 free calls per month. No credit card.

Get a free API key