Beispiel #1
0
def get_symbol_to_quotes(symbols):
    if len(symbols) == 0:
        return {}
    symbol_to_quote = {}
    try:
        quotes = httputil.get_json_object_from_url(
            "https://api.robinhood.com/quotes/?symbols={}".format(
                ",".join(symbols)))['results']
        for quote in quotes:
            if quote:
                symbol_to_quote[quote['symbol']] = quote
    except Exception as e:
        traceback.print_exc()
        print("ERROR: " + str(e))
    return symbol_to_quote
Beispiel #2
0
    def GET(self, url):

        winning_scores = httputil.get_json_object_from_url(
            "https://s3.amazonaws.com/api.stockstream.live/winners.json")

        weeks = ["week" + str(i) for i in range(1, 7)]

        valid_weeks = []
        scores = {}
        for week in weeks:
            if week in winning_scores:
                scores[week] = stockstream.scores.augment_ranked_scores(
                    winning_scores[week])
                valid_weeks.append(week)

        page_model = {
            'winning_scores': winning_scores,
            'valid_weeks': valid_weeks
        }

        return render.pages.winners(page_model)
Beispiel #3
0
def get_api_request(request):
    return httputil.get_json_object_from_url(config.SS_API_ENDPOINT + request)
Beispiel #4
0
def get_quote(symbol):
    return httputil.get_json_object_from_url(
        "https://api.robinhood.com/quotes/{}/".format(symbol))
Beispiel #5
0
def get_fundamentals(symbol):
    fundamentals = httputil.get_json_object_from_url(
        "https://api.robinhood.com/fundamentals/{}/".format(symbol))
    return fundamentals
Beispiel #6
0
def get_market_hours(date):
    market_date = httputil.get_json_object_from_url(
        "https://api.robinhood.com/markets/XNAS/hours/{}/".format(date))
    return market_date