I have a website dedicated to cryptocurrencies. I would like to integrate some indexes, prices or other real-time information about cryptocurrencies on it. I assume that I need to use API and Webflow Logic.
Maybe there are some examples I can use to understand this topic. Or guides that will explain me step by step how to do it.
Do you mean “web-scraping” @FlowKeeper? If yes you can use PuppeteerJS to scrape data with cron automations or you can try popular paid service Bright Data to get real time data.
For real-time information, web scraping likely won’t be the easiest approach. You’ll need to find a service or source that has an API and/or RSS feeds that you can consume.
Then, client-side JS to fetch and display it.
For many APIs, you’ll need a middle tier such as serverless functions in order to avoid CORS issues.
hi @FlowKeeper I believe that you can get these data with PuppeteerJS. Just try it in separate side project to see if they have any scraping protection. But I see that they have their own API with basic free plan to try.
To be honest I’ve just start learning what I can do with PuppeteerJS as I will like to use it in my next project (Electron app) when I finish my current Svelte custom elements library.
hi @FlowKeeper I was now checking the “Fear Index” and unfortunately “black dot” doesn’t have any value. This means you have nothing to grab. There is some function that will calculate it where should be placed.It will be possible to with PJS simulate click through “more” to access data from and to custom calculation or get element position coordinates with PJS but this will be too much hassle.
EDIT: I have had a second look and get “dot” position is actually easy as it is set by rotation degree in CSS that can be grabbed with PJS.
This means you can create your own index metering component and only grab deg value that will be applied on your component.
set in PJS cron automation to grab this value once per time of your choice eg. “minute” or “hour” or “day” or “week”
Just small hint: Once you have deg value you can convert it to any other unit (eg, %) if you would like to have metric component different than half circle.