Market Status (JSON)

Home

Dataset Information

For this exercise, we will use data from the AlphaVantage API. Specifically we will use the "Market Status" endpoint to fetch information about the current status of major trading venues around the world. Consult the API documentation to learn more.

Setup

First obtain an AlphaVantage API Key, and supply it when prompted.

Part 1

Write JavaScript code to answer the questions below. Log each of the answers to the console.

  1. Fetch market status data from the API.
  2. Display the number of markets.
  3. Filter the markets to identify only those that have a market type of "Equity", and store them in a variable called equityMarkets.
  4. Display the number of equity markets.
  5. Loop through the equity markets and display the market type and region of each.
  6. Use a find operation to identify the equity market that has a region of "United States", and store it in a variable called market.
  7. Display information about the US market, including: the market type, the primary exchanges, the local open and close time, and the current market status. Format the market status using all capital letters.

Part 2

Write JavaScript code to answer the questions below. Display the answers on the page in the designated areas.

  1. Using the designated span elements below, display information about the US market, including it's region, market type, primary exchanges, local open and close times, and current status.

Display

Region: TODO

Market Type: TODO

Primary Exchanges: TODO

Local Open: TODO

Local Close: TODO

Current Status: TODO