Skip to content

Client

stormlore.Client

The wxchange API client.

Parameters:

Name Type Description Default
api_key str | None

Your API key. Default: the WXCHANGE_API_KEY environment variable. Create one at https://app.wxchange.io (Settings → API keys).

None
base_url str | None

The API's address. Default: WXCHANGE_API_URL, else https://api.wxchange.io.

None
units str | None

The default for to_dataframe(): "native" (as served: kelvin, m/s, pascals), "metric" or "imperial". Values themselves are never changed.

None
timeout float

Seconds to wait for each response.

30.0
max_retries int

How many times a failed request is retried (0 turns retries off).

3

Raises:

Type Description
MissingApiKeyError

No key was given and WXCHANGE_API_KEY is unset or blank.

Attributes:

Name Type Description
forecast

Models and forecast queries.

tiles

PNG data tiles.

observations

Point observations, stations and area observations.

storm_reports

Storm reports and their county rollups.

radar

MRMS radar frames at a point.

scores

Model verification: the Shyft Score, history, regions, ranking, badges, scorecard.

advisories

Active watches, warnings and advisories, by ZIP code or point.

zips

What ZIP codes cover (state, NWS zones, SAME codes).

Example
with Client() as client:
    now = client.forecast.point("gfs", (41.26, -95.94), "temperature_2m")

health

health() -> Health

The API's health (answers without a key; status loading is not an error).

version

version() -> VersionInfo

What build of the API is running.

close

close() -> None

Close the connection pool.

stormlore.AsyncClient

The wxchange API client.

Parameters:

Name Type Description Default
api_key str | None

Your API key. Default: the WXCHANGE_API_KEY environment variable. Create one at https://app.wxchange.io (Settings → API keys).

None
base_url str | None

The API's address. Default: WXCHANGE_API_URL, else https://api.wxchange.io.

None
units str | None

The default for to_dataframe(): "native" (as served: kelvin, m/s, pascals), "metric" or "imperial". Values themselves are never changed.

None
timeout float

Seconds to wait for each response.

30.0
max_retries int

How many times a failed request is retried (0 turns retries off).

3

Raises:

Type Description
MissingApiKeyError

No key was given and WXCHANGE_API_KEY is unset or blank.

Attributes:

Name Type Description
forecast

Models and forecast queries.

tiles

PNG data tiles.

observations

Point observations, stations and area observations.

storm_reports

Storm reports and their county rollups.

radar

MRMS radar frames at a point.

scores

Model verification: the Shyft Score, history, regions, ranking, badges, scorecard.

advisories

Active watches, warnings and advisories, by ZIP code or point.

zips

What ZIP codes cover (state, NWS zones, SAME codes).

Example
async with AsyncClient() as client:
    now = await client.forecast.point("gfs", (41.26, -95.94), "temperature_2m")