import requests


def get_stock_data(symbol, token):
    """Send a request to the API with the symbol and token. Return the stock data we want:
    Symbol, Company Name, Current Price"""
    url = f"https://cloud.iexapis.com/stable/stock/{symbol}/quote?token={token}"
    response = requests.get(url)

    if response.status_code != 200:
        print(response.text)
        return None

    all_stock_data = response.json()
    name = all_stock_data["companyName"]
    symbol = all_stock_data["symbol"]
    current_price = all_stock_data["latestPrice"]

    stock_data = {"name": name, "symbol": symbol, "current_price": current_price}

    return stock_data