Stock Price Checker

Learning Objectives:

  1. Understand how to interact with financial APIs
  2. Practice making API requests and handling responses
  3. Learn how to parse and display stock data
  4. Gain experience in error handling and debugging

Instructions:

  1. Get a free API key from Alpha Vantage:
    • Sign up for a free account
    • You will receive your API key via email
  2. Paste your Alpha Vantage API key in the input field below
  3. Enter a stock ticker symbol (e.g., AAPL for Apple Inc.) and click "Get Stock Price"
  4. Observe the API response and how the data is displayed
  5. If there's an error, check the debug information and troubleshooting section below


Debug Information:


    

Troubleshooting API Issues:

  1. Verify that you've entered the Alpha Vantage API key correctly.
  2. Ensure you're using a valid stock ticker symbol.
  3. Check if you've reached the API call limit for your plan.
  4. If the stock data isn't found, try a different ticker symbol.

What's happening?

When you click "Get Stock Price", this application makes a call to the Alpha Vantage API:

  1. It sends a request to Alpha Vantage with the ticker symbol you provided.
  2. The API returns real-time stock data for that symbol.
  3. The application then parses this data and displays relevant information on the page.

If there's an error, check the debug information and troubleshooting section for details on what might be wrong and how to fix it.