Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Can't Access Minute Data research/notebooks

https://www.quantopian.com/research/notebooks/Cloned%20from%20%22Quantopian%20Lecture%20Series%3A%20Introduction%20to%20Research%22%201.ipynb

Doesn't work

aapl_minute_closes = get_pricing(  
    'AAPL',  
    fields='close_price', #modify to price, open_price, high, low or volume to change the field  
    start_date='2014-01-01', #customize your pricing date range  
    end_date = '2014-07-01',  
    frequency='minute', #change to daily for daily pricing  
)

# matplotlib is installed for easy plotting  
aapl_minute_closes.plot()  
---------------------------------------------------------------------------  
HTTPError                                 Traceback (most recent call last)  
<ipython-input-3-62a671187136> in <module>()  
      4     start_date='2014-01-01', #customize your pricing date range  
      5     end_date = '2014-07-01',  
----> 6     frequency='minute', #change to daily for daily pricing  
      7 )  
      8 

/build/src/qexec_repo/qexec/research/_api.pyc in get_pricing(symbols, start_date, end_date, symbol_reference_date, frequency, fields, handle_missing)
    642         frequency=frequency,  
    643         fields=fields,  
--> 644         handle_missing_mode=handle_missing,  
    645     )  
    646 

/build/src/qexec_repo/qexec/research/web/client.pyc in get_pricing(self, symbols, start_date, end_date, symbol_reference_date, frequency, fields, handle_missing_mode)
    243             symbol_reference_date,  
    244             frequency,  
--> 245             fields,  
    246         )  
    247 

/build/src/qexec_repo/qexec/research/web/helpers.pyc in _method(*args, **kwargs)
    128     def _method(*args, **kwargs):  
    129         response = f(*args, **kwargs)  
--> 130         response.raise_for_status()  
    131  
    132         # If we make it to here, that means we have a 200.  It still might

/usr/local/lib/python2.7/dist-packages/requests/models.pyc in raise_for_status(self)
    838  
    839         if http_error_msg:  
--> 840             raise HTTPError(http_error_msg, response=self)  
    841  
    842     def close(self):

HTTPError: 500 Server Error: INTERNAL SERVER ERROR for url: http://localhost:8080/api/pricing

4 responses

Perhaps its the ticker. This works but produces a panel which of course needs further work to extract the data you want to plot or inspct:

data = get_pricing(  
    ['F'],  
    start_date='2014-10-29',  
    end_date = '2014-10-31',  
    frequency='minute'  
)
data  
Share  
Out[18]:  
<class 'pandas.core.panel.Panel'>  
Dimensions: 6 (items) x 1170 (major_axis) x 1 (minor_axis)  
Items axis: open_price to price  
Major_axis axis: 2014-10-29 13:31:00+00:00 to 2014-10-31 20:00:00+00:00  
Minor_axis axis: Equity(2673 [F]) to Equity(2673 [F])  

ok....here we go....

aapl_minute_closes = get_pricing(  
    ['AAPL'],  
    fields='close_price', #modify to price, open_price, high, low or volume to change the field  
    start_date='2014-04-01', #customize your pricing date range  
    end_date = '2014-04-02',  
    frequency='minute', #change to daily for daily pricing  
)

# matplotlib is installed for easy plotting  
aapl_minute_closes.plot()  

Hi Anthony, thanks for bringing this up. We're aware of the issue, and there's another thread about it here; basically, the error occurs when start_date or end_date is a non-trading day. In the case of your original post, 2014-01-01 was New Year's. Watch the linked thread for updates.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Many thanks Nathan! Understood.