Back to Community
Server Error in get_pricing()
dat = get_pricing('APPL',  
    fields='close_price',  
    start_date='2016-01-01',  
    end_date = '2017-01-01',  
    frequency='minute',  
)
HTTPErrorTraceback (most recent call last)  
<ipython-input-85-161b6a01202d> in <module>()  
      3     start_date='2016-01-01', #customize your pricing date range  
      4     end_date = '2017-01-01',  
----> 5     frequency='minute', #change to daily for daily pricing  
      6 )  
      7 x = dat.resample("1h").last().dropna().values

/build/src/qexec_repo/qexec/research/_api.pyc in get_pricing(symbols, start_date, end_date, symbol_reference_date, frequency, fields, handle_missing)
    705         frequency=frequency,  
    706         fields=fields,  
--> 707         handle_missing_mode=handle_missing,  
    708     )  
    709 

/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)
    245             symbol_reference_date,  
    246             frequency,  
--> 247             fields,  
    248         )  
    249 

/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  
7 responses

I get the same error. if your start and end days are non-trading days you will get an error.

However, I adjusted the days to trading days and am still having issues ><

Hi, this issue was addressed several times in the past for 'minute' data, but this time it's happening with the 'daily' frequency as well:

HTTPErrorTraceback (most recent call last)  
<ipython-input-20-b21ac87e9f59> in <module>()  
      1 import pandas  
----> 2 get_pricing('SPY', start_date='2016-08-23', end_date='2016-12-01', **frequency='daily'**, fields='close_price')

/build/src/qexec_repo/qexec/research/_api.pyc in get_pricing(symbols, start_date, end_date, symbol_reference_date, frequency, fields, handle_missing)
    705         frequency=frequency,  
    706         fields=fields,  
--> 707         handle_missing_mode=handle_missing,  
    708     )  
    709 

/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)
    245             symbol_reference_date,  
    246             frequency,  
--> 247             fields,  
    248         )  
    249 

/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  

All previous posts seemed to be linked to the use of start and end dates that were non-trading days ie. weekends and holidays whereas adjusting to an actual trading day hasn't resolved it this time.

Hi Shmulik,

Thank you for your suggestion. However this doesn't solve my problem. I'm still getting the same error when fetching last week's data:
dat = get_pricing('APPL',
fields='close_price',
start_date='2017-02-20',
end_date = '2017-02-24',
frequency='daily',
)

Interestingly the code (without b-day adjustment) worked for me in the past, but stopped working since yesterday. My personal guess is, Quantopian was backed by AWS service while yesterday there was a major down time for them, so Quantopian was probably affected and didn't resume some the its service?

BTW, does the get_pricing have FIVE days delay for EOD data? I could not get the latest data for chart.

day_pricing = get_pricing('GOOG', fields='close_price', start_date='2017-2-1', end_date='2017-2-28')
print(day_pricing[-10:])

2017-02-14 00:00:00+00:00 820.39
2017-02-15 00:00:00+00:00 818.98
2017-02-16 00:00:00+00:00 824.16
2017-02-17 00:00:00+00:00 828.07
2017-02-21 00:00:00+00:00 831.66
2017-02-22 00:00:00+00:00 NaN
2017-02-23 00:00:00+00:00 NaN
2017-02-24 00:00:00+00:00 NaN
2017-02-27 00:00:00+00:00 NaN
2017-02-28 00:00:00+00:00 NaN
Name: Equity(46631 [GOOG]), dtype: float64

Seems that it's back.

It's back again