Hey everyone,
I’m trying to work with the Bulk Fundamentals endpoint and having trouble parsing the JSON properly. I can fetch the data just fine, but since it returns a dictionary with tickers as keys, I’m unsure how to loop through it effectively and extract key metrics like market_cap, pe_ratio, and dividend_yield for each ticker.
If anyone has a simple Python snippet or tips on handling this structure efficiently, I’d really appreciate it!
Yeah, that format tripped me up too at first. You can just iterate over the dictionary using .items() — like:
for ticker, data in response.items():
print(ticker, data.get(“General”, {}).get(“MarketCapitalization”))
I built a small function that pulls out the values I need into a pandas DataFrame. Makes it easier to sort and filter later. Let me know if you want me to share it.
I’ve been working with this endpoint too just a heads up, not all tickers have complete data. I usually add a check for None values before doing any math with the fields. Saves time on debugging strange errors.
Also, if you’re doing a lot of tickers at once, try saving the parsed data locally in a .json or .csv. That way you don’t have to re-fetch during testing. It speeds things up a lot