massive-com / massive-com/client-python

Historic market cap data is incorrect

Open
#1,016 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.