Skip to content

Instantly share code, notes, and snippets.

@ryonagana
Created April 14, 2019 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryonagana/d273b61da2c9db810ac69442ebb0497c to your computer and use it in GitHub Desktop.
Save ryonagana/d273b61da2c9db810ac69442ebb0497c to your computer and use it in GitHub Desktop.
from flask import Flask
import json
import urllib.request
app = Flask(__name__)
@app.route('/')
def hello_world():
r = urllib.request.urlopen('https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=VALE3.SA&interval=5min&apikey=PN6ZAMT6VK4BZTFU')
response_text = r.read.
return app.response_class(
response= r.read().encode('utf-8'),#r.text,
status=200,
mimetype='application/json; charset=UTF-8'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment