Repository navigation
Releases: feuerstein-org/massive-api
Release list
v0.4.1
A reliability release: transient failures are now retried automatically, add timeout control, and session management was tightened up.
Retries for 5xx and transport failures
Requests that fail with a 5xx status, a timeout, or a connection error are now retried up
to max_retries (default 3) with the same exponential backoff already used for 429s.
If the failure persists past max_retries, ServerError, TransportError or MaxRetriesExceededError is raised respectively. Set max_retries=0 to disable retries.
Per-request timeout
New request_timeout config option (default 30 seconds, covering connect + read).
Previously requests could hang for aiohttp's default 5 minutes. If you supply your own
session, its timeout settings are used instead.
config = MassiveApiConfig(
api_key="YOUR_API_KEY",
max_retries=3, # exponential backoff on HTTP 429, 5xx, and transport errors
request_timeout=30, # per-request timeout in seconds
)v0.4.0
This release adds a proper exception hierarchy so HTTP failures are classified and catchable by type.
Typed HTTP errors
HTTP failures now raise a MassiveApiHTTPError (or a specific subclass) instead of a raw
aiohttp.ClientResponseError. Each carries the status and the server message:
AuthenticationError— 401 / 403 (missing/invalid key or insufficient entitlement)NotFoundError— 404 (resource does not exist)ServerError— 5xx (a fault on the Massive API side)MassiveApiHTTPError— the base class, for any other non-2xx status
from massive_api import AuthenticationError, ServerError
try:
tickers = await api.reference_api.get_all_tickers(market="stocks")
except AuthenticationError:
... # check your API key
except ServerError as e:
... # transient upstream fault, status in e.statusAll of the above (plus the base MassiveApiError and MaxRetriesExceededError) are exported from
the top-level massive_api package.
v0.3.0
A small release with a behavior change to "not found" handling and more predictable defaults.
404s on single-ticker lookups now return None
get_ticker_overview and get_ticker_events (and their _raw variants) now return None when the
ticker doesn't exist (HTTP 404) instead of raising:
overview = await api.reference_api.get_ticker_overview("NOPE")
if overview is None:
... # unknown tickerThis is a behavior change: those methods now return Optional, so a None check is required.
Other errors (401, 429, 5xx) still raise as before, and list endpoints like get_all_tickers
continue to return an empty list.
Defaults are now set client-side
sort, order, and active now default explicitly in the client (e.g. tickers sort by ticker
ascending, splits by execution_date descending) instead of relying on the API's defaults. This
makes results deterministic and independent of any server-side changes.
v0.2.0
This release adds the dividends API - https://massive.com/docs/rest/stocks/corporate-actions/dividends
You can use it like this:
dividends = await api.dividends_api.get_dividends(
ticker="AAPL",
ex_dividend_date_gte="2024-01-01",
sort="ex_dividend_date",
order="desc",
)v0.1.0
Initial Release of massive-api!
This is a lightweight async python client of the Massive API.
A couple features:
- async
- builtin rate limiting
- builtin retries
- Pydantic Validation of responses
- Fully Typed
For now only a few APIs are supported but more will come soon!