massive-api-client
massive-api-client is an async wrapper around parts of the official massive Python client.
It focuses on two things:
- async access to selected Massive.com REST APIs
- automatic sleeping and retrying when a rate limit is hit, which is especially helpful on the free tier
This package is still a work in progress, so it currently supports only a subset of endpoints. It reuses response models from massive.rest.models, which makes it easy to work alongside the official client.
Features
- Async client built on
httpx.AsyncClient - Reuses models from the official
massivepackage - Async pagination support through
async for - Built-in retry/sleep behavior for HTTP
429 Too Many Requests - Small and focused API surface
Supported APIs
Reference
list_tickers(...)get_ticker_details(ticker, ...)get_ticker_events(ticker, ...)list_ticker_news(...)get_ticker_types(...)get_related_companies(ticker)
Aggregates
list_aggs(ticker, multiplier, timespan, from_, to, ...)get_grouped_daily_aggs(date, ...)
Indicators
get_sma(ticker, ...)get_ema(ticker, ...)get_rsi(ticker, ...)get_macd(ticker, ...)
Installation
Install from PyPI:
pip install massive-api-client
Quick Start
import asyncio
from massive_api_client import MassiveAPIClient
from massive_api_client.config import MassiveClientConfig
async def main() -> None:
client = MassiveAPIClient(
MassiveClientConfig(
massive_api_key="YOUR_MASSIVE_API_KEY",
)
)
try:
details = await client.get_ticker_details("AAPL")
print(details.name)
sma = await client.get_sma("AAPL", timespan="day", window=10, limit=5)
print(sma.values[0].value)
tickers = [
ticker
async for ticker in client.list_tickers(search="apple", limit=5, max_num_pages=1)
]
print([ticker.ticker for ticker in tickers])
finally:
await client.close()
asyncio.run(main())
Pagination
The following methods return async iterators:
list_tickers(...)list_ticker_news(...)list_aggs(...)
Example:
bars = [
bar
async for bar in client.list_aggs(
ticker="AAPL",
multiplier=1,
timespan="day",
from_="2024-01-01",
to="2024-01-31",
max_num_pages=1,
)
]
max_num_pages is available as a defensive guard for paginated endpoints. It is default to 10000 pages.
Rate Limit Handling
When Massive returns HTTP 429, the client will:
- sleep for
rate_limit_sleep_secs - retry the same request
- repeat until
rate_limit_max_retriesis reached
If the request is still rate-limited after all retries, a RateLimitException is raised.
Default settings:
rate_limit_sleep_secs=60.0rate_limit_max_retries=3
Configuration
Use MassiveClientConfig to configure the client:
from massive_api_client.config import MassiveClientConfig
config = MassiveClientConfig(
massive_api_key="YOUR_MASSIVE_API_KEY",
api_base_url="https://api.massive.com",
timeout_secs=30.0,
rate_limit_sleep_secs=60.0,
rate_limit_max_retries=3,
)
Fields:
massive_api_key: required Massive API keyapi_base_url: defaults tohttps://api.massive.comtimeout_secs: request timeout in seconds, default to 30 secondsrate_limit_sleep_secs: how long to wait before retrying after HTTP429, default to 1 minuterate_limit_max_retries: maximum retry attempts after HTTP429, default to 3 - meaning together with the initial call, it will call the API upto 4 times
Return Types
Responses are deserialized into models from the official massive package, for example:
TickerTickerDetailsTickerNewsTickerTypesAggGroupedDailyAggSMAIndicatorResultsEMAIndicatorResultsRSIIndicatorResultsMACDIndicatorResults
This means you can keep using the official model types while switching to an async workflow.
Errors
RateLimitException: raised when rate-limit retries are exhaustedBadResponseException: raised when the API response is missing an expected fieldhttpxexceptions: non-rate-limit HTTP failures are surfaced byhttpx
Notes
- This project is intentionally small (focusing on author's personal requirements) and currently covers only part of the Massive API.
- The client is not an async context manager right now, so close it explicitly with
await client.close().
Development
pip install -e . pytest
pytest
License
MIT
Metadata
Release files for massive-api-client 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| massive_api_client-0.0.4.tar.gz | 11.7 kB | With provenance | Details for massive_api_client-0.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| massive_api_client-0.0.4-py3-none-any.whl | Python 3 | none | any | Details for massive_api_client-0.0.4-py3-none-any.whl |
Total release size: 24.2 kB
Release files / massive_api_client-0.0.4.tar.gz
| Download URL | massive_api_client-0.0.4.tar.gz |
|---|---|
| Size | 11.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
840ce4dce7f0624b97bb57ed5410792bf9fe4c83b9b9e167e22f5f00e034148d
|
|
BLAKE2b-256 checksum How to use checksums |
2d270429d33082924b05911b592e9a36dfa488bceea80c6eca4fccc503da47c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 14, 2026.
Transparency logRelease files / massive_api_client-0.0.4-py3-none-any.whl
| Download URL | massive_api_client-0.0.4-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a26f27c692244f78b3bdb0d75239cfe271578d4d6f01984c9d010d8c79d4e06c
|
|
BLAKE2b-256 checksum How to use checksums |
a53f301d577c9dd22b7de4a8ccec51271795d97db870804fb960657f86705a25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 14, 2026.
Transparency logSecurity for massive-api-client 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for massive_api_client-0.0.4.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 14, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.