Skip to content

Guides

Credentials

Weather observations, climate, and the default training-table path call public endpoints without an account. Credentials unlock specific licensed, deeper-history, or hosted paths; they do not change the name of the source that produced a row.

from mostlyright import weather
table = weather.training_table(
"KNYC",
"2025-01-06",
"2025-01-12",
)

No key is required for that call.

VariableUsed forWithout it
FRED_API_KEYALFRED first-print economic vintages and deeper FRED-backed historyLatest-revised agency fallbacks may remain available, but first-print reads can raise with this key named as the fix
BEA_API_KEYBEA GDP fallbackGDP paths that require BEA raise a typed source-availability error
BLS_API_KEYHigher BLS request limitsUnkeyed BLS limits apply
EUMETSAT_CONSUMER_KEY + EUMETSAT_CONSUMER_SECRETMeteosat satellite objectsMeteosat raises a typed error; other satellite families are unaffected
MOSTLYRIGHT_WEATHER_HOSTED_URL + MOSTLYRIGHT_API_KEYHosted weather serving, including hosted satellite deliveryLocal weather reads remain the default; hosted calls fail configuration checks
MOSTLYRIGHT_FINANCE_HOSTED_URL + MOSTLYRIGHT_API_KEYHosted earnings transcript REST/streamLocal finance paths remain separate
MOSTLYRIGHT_ECONOMY_HOSTED_URL + MOSTLYRIGHT_API_KEYReserved hosted economy transportdelivery="hosted" is unavailable until that transport lands
MOSTLYRIGHT_CACHE_DIRRelocate the local cacheDefaults to ~/.mostlyright/cache/
MOSTLYRIGHT_CWOP_DIRRelocate CWOP registry/capture stateUses the default CWOP location

The 2.0 hosted names are fully namespaced. WEATHER_HOSTED_URL, EARNINGS_HOSTED_URL, and MOSTLYRIGHT_CWOP_HOME are old names and are not the current configuration contract.

Terminal window
export FRED_API_KEY="..."
export MOSTLYRIGHT_WEATHER_HOSTED_URL="https://weather.example"
export MOSTLYRIGHT_API_KEY="..."

Use a shell profile for local development and your platform’s secret manager in production. Do not commit .env files containing real keys.

  • Missing credentials fail loudly with the exact variable named.
  • Invalid source/delivery values fail before network I/O.
  • Credentials change access, not provenance. A keyed ALFRED row is still identified as its actual source.
  • Hosted calls require both the service URL and MOSTLYRIGHT_API_KEY.

The TypeScript hosted helpers accept explicit configuration because browsers do not have a safe, general-purpose process environment:

import { satelliteHosted } from "@mostlyrightmd/weather/hosted";
const result = await satelliteHosted({
hostedUrl,
apiKey,
station: "KNYC",
fromTime: "2025-01-06T00:00:00Z",
toTime: "2025-01-07T00:00:00Z",
satellite: "goes16",
});

Do not ship a durable shared API key in a public web bundle. Put credentialed calls behind your backend or mint a short-lived scoped token.