title: Trying to make a search bar which auto search on typing letters ( Flask-python +api call)
body: <p>It's my first time using an API and I'm trying to make my search bar give back results on every letter that is typed ( i succeed to search on words but not on letters yet)</p>
  <p>so I made a function that calls the API and returns some data based on the word(symbol) you are going to search</p>
  <pre><code>def lookup(symbol):
      &quot;&quot;&quot;Look up quote for symbol.&quot;&quot;&quot;
  
      # Contact API
      try:
          api_key = os.environ.get(&quot;API_KEY&quot;)
          url = f&quot;https://cloud.iexapis.com/stable/stock/{urllib.parse.quote_plus(symbol)}/quote?token={api_key}&quot;
          response = requests.get(url)
          response.raise_for_status()
      except requests.RequestException:
          return None
  
      # Parse response
      try:
          quote = response.json()
          return {
              &quot;name&quot;: quote[&quot;companyName&quot;],
              &quot;price&quot;: float(quote[&quot;latestPrice&quot;]),
              &quot;symbol&quot;: quote[&quot;symbol&quot;]
          }
      except (KeyError, TypeError, ValueError):
          return None
  </code></pre>
  <p>this is my simple form</p>
  <pre><code>    &lt;form action=&quot;/search&quot; method=&quot;GET&quot;&gt;
    &lt;input
      type=&quot;search&quot;
      autofocus
      name=&quot;symbol&quot;
      id=&quot;symbol&quot;
      placeholder=&quot;Write a stock quote&quot;
    /&gt;
  </code></pre>
  <p>Can anyone give me an idea on how to do it, typing a letter and not a word?
  With javascript or directly on python</p>