Stock Data Fetch & Graph

Marko Ringo
Mar 29, 2023

--

Tools: React, fetch(), Chart.js

Functionality

  • select companies from React Select dropdown;
  • retrieve data from Polygon.io API;
  • graph closing price of stock for past 30 days.

Comments

The goal was to (1) fetch data in real-time and dynamically (dates and company ticker not hard-coded), (2) plot the received data onto a React Chart.js. Since I had already worked with Axios before, I implemented here the native fetch() method with its double promise — to experiment with something new. A short but enjoyable project!

Code: https://github.com/mar-rin/stockfetch

Deployed: https://codesandbox.io/s/stockprices-yepn8l

--

--