title: Iterate over json api and append results to pandas dataframe
body: <p>I'm attempting to load Excel data into a Pandas DataFrame and then push the ip_address from the DataFrame to an api which returns information back in json format, and then append the results from the json back to the original DataFrame - how would I do this, iterating over each row in the dataframe and appending the results back each time?</p>
  <p>Initial dataframe:</p>
  <pre><code>date | ip | name
  date1 | ip1 | name1
  date2 | ip2 | name2
  </code></pre>
  <p>json:</p>
  <pre><code>{
      &quot;status&quot;: &quot;ok&quot;,
      &quot;8.8.8.8&quot;: {
          &quot;proxy&quot;: &quot;yes&quot;,
          &quot;type&quot;: &quot;VPN&quot;,
          &quot;provider&quot;: &quot;Google Inc&quot;,
          &quot;risk&quot;: 66
      }
  }
  </code></pre>
  <p>Code:</p>
  <pre><code>df = pd.read_excel (r'test_data.xlsx')
  
  def query_api(ip_address):
      risk_score = None
      vpn_score = None
      api_key = &quot;xxx&quot;
      base_url = &quot;http://falseacc.com/&quot;
      endpoint = f&quot;{base_url}{ip_address}?key={api_key}&amp;risk=1&amp;vpn=1&quot;
      r = requests.get(endpoint)
      if r.status_code not in range(200, 299):
          return None, None
      try:
          with urllib.request.urlopen(endpoint) as url:
              data = json.loads(url.read().decode())
              proxy = (data[ip_address]['proxy'])
              type = (data[ip_address]['type'])
              risk = (data[ip_address]['risk'])
              df2 = pd.Dataframe({&quot;ip&quot;:[ip_address],
                                  &quot;proxy&quot;:[proxy],
                                  &quot;type&quot;:[type],
                                  &quot;risk&quot;:[risk]})
              print(df2)
      except:
          print(&quot;No data&quot;)
  </code></pre>
  <p>Expected output:
  Dataframe:</p>
  <pre><code>date | ip | name | proxy | type | risk
  date1 | ip1 | name1 | proxy1 | type1 | risk1
  date2 | ip2 | name2 | proxy2 | type2 | risk2
  </code></pre>