Data APIs: Stock Quote Sample

Yahoo Finance is an example of a very simple-to-use data API (web service).

The following link:
doesn't return a web page (HTML) it returns data in CSV form. CSV stands for comma separated value.

Specifically, it returns: "IBM",187.09,"11/17/2011","12:05pm",+0.47,186.81,188.83,186.51,2190514

Here's the spec for the API:

App Inventor Web Component
important property: Url -- specify the data API you want to access
important function call: Get  -- this requests the data
important event-handler: GotText -- this is triggered when the data arrives.


responseContent -- this is the data returned from the API in a text object.
list from csv row -- function that splits the data into items using the commas as delimiters.

Your Turn
1. Recreate this app. The UI should have a single button, GetQuoteButton, a label named ValueLabel, and a Web component. Make the ValueLabel large so that the
stock score is easy to see. Test the app.
2. Modify the blocks, changing IBM to some other stock, e.g., GOOG. Test to make sure it works.
3. Modify the app so that it shows your favorite stock both on the button click and startup of the app.
4. SaveAs this app. This is one of two apps you'll submit on your portfolio page.
5. For the second app, do the following:
  •  let the user enter a stock symbol in a textbox and click submit to see its value.
  • Make it so the app shows both the current value and the percentage change for the day. Check out to understand the API and how to get %change.
extra credit:
1. Create an app that upon starting shows the value of your five favorite stocks (fixed data on this one)
2. Create an app that lets the user choose his favorite stocks (any number of them) and lists the value of those.