DEV Community

Discussion on: building a real-time cryptocurrency info table with React, MUI(material-ui) and coinmarket cap API

Collapse
 
kevinkh89 profile image
keyvan

thank you @riskezwn .

  1. you need to deal with CORS policy.
    the coinmarketcap API docs:

    Making HTTP requests on the client side with Javascript is currently prohibited >through CORS configuration. This is to protect your API Key which should not be >visible to users of your application so your API Key is not stolen. Secure your API Key >by routing calls through your own backend service.

  2. exposing your API key

  3. any time a client visit the website or hit refresh there is a new call to the api endpoint.given the request limit(although you can subscribe to other plans), you could reach the limit in no time.by having a backend you can call the api on a specific time interval and cache the data then send the cache data back to the client.even on a free plan, that is 333 request per day, you can build a great info table

Collapse
 
riskezwn profile image
riskezwn

Thank you very much for your reply!