Data API
Access your weather station data via a set of HTTP and streaming endpoints. These are designed for customers to pull real-time or periodic data into their own apps or tools.
Stream realtime data via SSE (Recommended)
This endpoint provides a live data stream using Server-Sent Events (SSE). This route is ideal for real-time applications that need continuous updates without polling.
SSE is the preferred approach as it minimizes network overhead and avoids repeated HTTP requests.
https://ws.columbiaweather.com/api/v1/accounts/{account}/stations/{station}/realtimedata/
Usage example:
const source = new EventSource(
"https://ws.columbiaweather.com/api/v1/accounts/{account}/stations/{station}/realtimedata/"
);
source.onmessage = (event: MessageEvent) => {
try {
const data = JSON.parse(event.data);
console.log(data);
} catch (error) {
console.error("Error parsing JSON:", error);
}
};
source.onerror = (error) => {
console.error("EventSource error:", error);
};
# using https://pypi.org/project/sseclient/
from sseclient import SSEClient
data_stream = SSEClient("https://ws.columbiaweather.com/api/v1/accounts/{account}/stations/{station}/realtimedata/")
for data in data_stream:
print(data)
curl -N https://ws.columbiaweather.com/api/v1/accounts/{account}/stations/{station}/realtimedata/
Request latest data
For applications that don’t need continuous updates, this endpoint returns the most recent station data on demand.
⚠️ Note: This endpoint is suitable for occasional polling. Heavy use may be rate limited in the future.
https://ws.columbiaweather.com/api/v1/accounts/{account}/stations/{station}/latestdata/
Usage example:
interface SampleData {
measData: Record<string, string | float>
stationid: string
updateTS: string // iso timestamp
}
async function fetchLatestData(): Promise<SampleData | null> {
try {
const res = await fetch(
"https://ws.columbiaweather.com/api/v1/accounts/{account}/stations/{station}/latestdata/"
);
if (!res.ok) {
console.error(`HTTP Error: ${res.status} ${res.statusText}`);
return null;
}
if (res.status === 204) {
return null; // No data yet
}
return await res.json();
} catch (error) {
console.error("Fetch failed:", error);
return null;
}
}
import aiohttp
import asyncio
import logging
from typing import Optional, TypedDict
class SampleData(TypedDict):
updateTS: str # iso timestamp
stationid: str
measData: dict[str, float | str]
async def fetch_latest_data() -> Optional[SampleData]:
url = "https://ws.columbiaweather.com/api/v1/accounts/{account}/stations/{station}/latestdata/"
try:
async with aiohttp.ClientSession() as session:
async with session.get(url) as res:
# Log and return None if the status isn't 200 or 204.
if res.status not in (200, 204):
logging.error(f"HTTP Error: {res.status}")
return None
# For 204 (No Content), return None.
if res.status == 204:
return None
return await res.json()
except Exception as error:
logging.error("Fetch failed: %s", error)
return None
async def main():
data = await fetch_latest_data()
if data is not None:
print(data["measData"])
if __name__ == '__main__':
asyncio.run(main())
curl "https://ws.columbiaweather.com/api/v1/accounts/{account}/stations/{station}/latestdata/"