title: Yahoo Finance Python API JSON error?
body: <p>I have been trying to use the Yahoo Finance Python API to get historical prices but I every time I try to run my code, I get the same error. Here is my code and the error:</p>
  
  <p>The Python Code</p>
  
  <pre><code>from yahoo_finance import Share 
  
  name = Share('YHOO') 
  temp = (name.get_historical('2014-04-25','2015-04-29'))
  
  print (temp)
  </code></pre>
  
  <p>And the Error Message</p>
  
  <pre><code>&gt; 
  &gt; JSONDecodeError                           Traceback (most recent call
  &gt; last) &lt;ipython-input-1-65dd835a5e8b&gt; in &lt;module&gt;()
  &gt; ----&gt; 1 from fetch import *
  &gt; 
  &gt; /Users/peterbullard/SMP/fetch.py in &lt;module&gt;()
  &gt;       3 
  &gt; ----&gt; 4 name = Share('YHOO')
  &gt;       5 temp = (name.get_historical('2014-04-25', '2015-04-29'))
  &gt;       6 
  &gt; 
  &gt; /Users/peterbullard/anaconda/lib/python3.5/site-packages/yahoo_finance-1.2.1-py3.5.egg/yahoo_finance/__init__.py
  &gt; in __init__(self, symbol)
  &gt;     176         self._table = 'quotes'
  &gt;     177         self._key = 'symbol'
  &gt; --&gt; 178         self.refresh()
  &gt;     179 
  &gt;     180     def _fetch(self):
  &gt; 
  &gt; /Users/peterbullard/anaconda/lib/python3.5/site-packages/yahoo_finance-1.2.1-py3.5.egg/yahoo_finance/__init__.py
  &gt; in refresh(self)
  &gt;     140 
  &gt;     141         """
  &gt; --&gt; 142         self.data_set = self._fetch()
  &gt;     143 
  &gt;     144 
  &gt; 
  &gt; /Users/peterbullard/anaconda/lib/python3.5/site-packages/yahoo_finance-1.2.1-py3.5.egg/yahoo_finance/__init__.py
  &gt; in _fetch(self)
  &gt;     179 
  &gt;     180     def _fetch(self):
  &gt; --&gt; 181         data = super(Share, self)._fetch()
  &gt;     182         if data['LastTradeDate'] and data['LastTradeTime']:
  &gt;     183             data[u'LastTradeDateTimeUTC'] = edt_to_utc('{0} {1}'.format(data['LastTradeDate'], data['LastTradeTime']))
  &gt; 
  &gt; /Users/peterbullard/anaconda/lib/python3.5/site-packages/yahoo_finance-1.2.1-py3.5.egg/yahoo_finance/__init__.py
  &gt; in _fetch(self)
  &gt;     132     def _fetch(self):
  &gt;     133         query = self._prepare_query(table=self._table, key=self._key)
  &gt; --&gt; 134         data = self._request(query)
  &gt;     135         return data
  &gt;     136 
  &gt; 
  &gt; /Users/peterbullard/anaconda/lib/python3.5/site-packages/yahoo_finance-1.2.1-py3.5.egg/yahoo_finance/__init__.py
  &gt; in _request(self, query)
  &gt;     116 
  &gt;     117     def _request(self, query):
  &gt; --&gt; 118         response = yql.YQLQuery().execute(query)
  &gt;     119         try:
  &gt;     120             _, results = response['query']['results'].popitem()
  &gt; 
  &gt; /Users/peterbullard/anaconda/lib/python3.5/site-packages/yahoo_finance-1.2.1-py3.5.egg/yahoo_finance/yql.py
  &gt; in execute(self, yql, token)
  &gt;      58 
  &gt;      59     self.connection.request('GET', PUBLIC_API_URL + '?' + urlencode({ 'q': yql, 'format': 'json', 'env': DATATABLES_URL }))
  &gt; ---&gt; 60     return simplejson.loads(self.connection.getresponse().read())
  &gt;      61 
  &gt;      62   def __del__(self):
  &gt; 
  &gt; /Users/peterbullard/anaconda/lib/python3.5/site-packages/simplejson/__init__.py
  &gt; in loads(s, encoding, cls, object_hook, parse_float, parse_int,
  &gt; parse_constant, object_pairs_hook, use_decimal, **kw)
  &gt;     514             parse_constant is None and object_pairs_hook is None
  &gt;     515             and not use_decimal and not kw):
  &gt; --&gt; 516         return _default_decoder.decode(s)
  &gt;     517     if cls is None:
  &gt;     518         cls = JSONDecoder
  &gt; 
  &gt; /Users/peterbullard/anaconda/lib/python3.5/site-packages/simplejson/decoder.py
  &gt; in decode(self, s, _w, _PY3)
  &gt;     368         if _PY3 and isinstance(s, binary_type):
  &gt;     369             s = s.decode(self.encoding)
  &gt; --&gt; 370         obj, end = self.raw_decode(s)
  &gt;     371         end = _w(s, end).end()
  &gt;     372         if end != len(s):
  &gt; 
  &gt; /Users/peterbullard/anaconda/lib/python3.5/site-packages/simplejson/decoder.py
  &gt; in raw_decode(self, s, idx, _w, _PY3)
  &gt;     398             elif ord0 == 0xef and s[idx:idx + 3] == '\xef\xbb\xbf':
  &gt;     399                 idx += 3
  &gt; --&gt; 400         return self.scan_once(s, idx=_w(s, idx).end())
  &gt; 
  &gt; JSONDecodeError: Expecting value: line 1 column 1 (char 0)
  </code></pre>
  
  <p>If it helps, I am using Jupyter Notebook and Python 3. </p>
  
  <p>This is the console log from terminal.</p>
  
  <blockquote>
    <p>W 08:59:40.681 NotebookApp] Unrecognized JSON config file version,
    assuming version 1 [I 08:59:41.410 NotebookApp] [nb_conda_kernels]
    enabled, 2 kernels found [I 08:59:41.459 NotebookApp] The port 8888 is
    already in use, trying another port. [I 08:59:41.765 NotebookApp]
    [nb_anacondacloud] enabled [I 08:59:41.768 NotebookApp] [nb_conda]
    enabled [I 08:59:41.821 NotebookApp] ✓ nbpresent HTML export ENABLED
    [W 08:59:41.821 NotebookApp] ✗ nbpresent PDF export DISABLED: No
    module named 'nbbrowserpdf' [I 08:59:41.825 NotebookApp] Serving
    notebooks from local directory: /Users/peterbullard [I 08:59:41.825
    NotebookApp] 0 active kernels  [I 08:59:41.825 NotebookApp] The
    Jupyter Notebook is running at: <a href="http://localhost:8889/" rel="nofollow">http://localhost:8889/</a> [I 08:59:41.825
    NotebookApp] Use Control-C to stop this server and shut down all
    kernels (twice to skip confirmation). [I 08:59:53.346 NotebookApp]
    Kernel started: 92b75861-94a5-4002-9ab4-97988c0cebfe [W 08:59:53.365
    NotebookApp] 404 GET /kernelspecs/Python%20[Root]/logo-64x64.png (::1)
    11.76ms referer=<a href="http://localhost:8889/notebooks/SMP/Test.ipynb" rel="nofollow">http://localhost:8889/notebooks/SMP/Test.ipynb</a> [I 08:59:55.917 NotebookApp] Kernel restarted:
    92b75861-94a5-4002-9ab4-97988c0cebfe</p>
  </blockquote>