Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
How do I access historical fundamental data?

So far I've been running code to pull fundamental data and the code has been like:

        fundamentals.balance_sheet.total_capitalization,  
    )  
    .filter(  
        fundamentals.operation_ratios.roa > 0.10  
    )  
    .filter(  
        fundamentals.operation_ratios.roe > 0.20  
    )  
    .filter(  
        fundamentals.operation_ratios.net_margin > 0.20  
    )  
    .filter(  
        fundamentals.balance_sheet.total_capitalization < 200000000  
    )  
    .order_by(  
        fundamentals.valuation.market_cap.desc()  
    )  
    .limit(context.limit)  
)  

...but that, I assume, just pulls data for the most recent quarter. What kind of code must I use to pull historical fundamental data to, for example, find companies whose current EPS is up over 25% compared to one quarter ago? Or companies whose sales that are up by a certain percentage in this most recent quarter over the same quarter last year?

2 responses

You can use the pipeline API to access historical data. But there are serious limitations to how much data you can pull . In that thread I have a notebook attached with an example of a pipeline with some interesting data and computation.

Sunil

Thank you, Sunil!