title: How to combine request from external API and send it as a response in Flask
body: <p>I'm hitting the Hacker news API <a href="https://github.com/HackerNews/API" rel="nofollow">here</a> and want to get the details of each posts that I get through the JSON. I want to send this JSON to my React front-end. </p>
  
  <p>This request is taking a long time. What do I need to do to send the response? </p>
  
  <pre><code>@app.route('/api/posts')    
  def get_posts():
      r = requests.get('https://hacker-news.firebaseio.com/v0/askstories.json?print=pretty')
      data = r.text
      jsonData = []
      for post in data:
          r = requests.get('https://hacker-news.firebaseio.com/v0/item/'+post+'.json?print=pretty')
          r.text
          jsonData.append(r.text)
      jsonData = jsonify(jsonData)
      print jsonData  
      return jsonData
  </code></pre>