Skip to main content

Authentication

All API requests require authentication using an API key. Include your API key in the x-api-key header.


Get your API key

Email support@snowtrail.ai to receive your API credentials.

Using Your API Key​

curl https://api.snowtrail.ai/health \
-H "x-api-key: YOUR_API_KEY"

Keep your API key secure
  • Never commit API keys to version control
  • Don't share keys publicly or in client-side code
  • Use environment variables or secrets management in production

Making Your First Request​

Let's fetch the latest system stress signal for the US natural gas market.

curl "https://api.snowtrail.ai/gbsi_us/system_stress?latest=true" \
-H "x-api-key: YOUR_API_KEY"

Response Format​

{
"product_id": "gbsi_us",
"count": 1,
"has_more": false,
"next_cursor": null,
"data": [
{
"signal_date": "2026-01-24",
"stress_regime": 2,
"stress_regime_label": "Balanced",
"confidence_score": 0.82,
"str_effective_at": "2026-01-24",
"str_ingested_at": "2026-01-24T14:30:00Z"
}
],
"metadata": {
"retrieved_at": "2026-01-24T15:00:00Z",
"total_count": 1,
"record_id": "req_abc123",
"data_latest_date": "2026-01-24",
"data_age_hours": 0.5
}
}

Environment Variables​

We recommend storing your API key as an environment variable:

export SNOWTRAIL_API_KEY="your-api-key"

Then reference it in your code:

import os
import requests

api_key = os.environ.get("SNOWTRAIL_API_KEY")
headers = {"x-api-key": api_key}