massive-com / massive-com/client-python
Historic market cap data is incorrect
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.5k
- Forks
- 362
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Historic market cap data is incorrect
To Reproduce
client = RESTClient(api_key=api_key)
date = ["2004-03-30", "2004-04-01", "2017-03-30", "2017-04-01", "2026-03-27"]
ticker = "AAPL"
for d in date:
details = client.get_ticker_details(ticker, date=d)
print(f"date: {d} market_cap: {int(details.market_cap)/1e9:.2f}B")
Output:
AAPL:
date: 2004-03-30 market_cap: 458.07B
date: 2004-04-01 market_cap: 444.78B
date: 2017-03-30 market_cap: 2361.37B
date: 2017-04-01 market_cap: 2356.94B
date: 2026-03-27 market_cap: 3652.67B
MSFT:
date: 2004-03-30 market_cap: 189.20B
date: 2004-04-01 market_cap: 188.30B
date: 2017-03-30 market_cap: 493.35B
date: 2017-04-01 market_cap: 494.48B
date: 2026-03-27 market_cap: 2649.24B
Expected behavior
AAPL is off by almost 2 magnitude on 2004-03-30 according to https://companiesmarketcap.com/apple/marketcap/
MSFT is off by ~80B on 2004-03-30 according to https://companiesmarketcap.com/microsoft/marketcap/
2017 data also off
Additional context
Additionally, is there other ways of querying for market cap and weighted_shares_outstanding of a ticker for a range of dates, other than to query get_ticker_details for each date separately?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the supplied Python example through RESTClient.get_ticker_details, then compare the returned historical values with the cited CompaniesMarketCap data. Trace whether the discrepancy originates in the client or the service, and determine whether a date-range query for market cap and weighted_shares_outstanding is already supported or needs a separate request.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100