DavidReider / MagicEdenFloorTrack

A simple floor price tracker for Magic Eden.
https://solanafloortracker.netlify.app/
27 stars 13 forks source link

Data Source Issue #15

Open DavidReider opened 2 years ago

DavidReider commented 2 years ago

The current website now is hitting this error on page load: Access to fetch at 'https://api-mainnet.magiceden.io/rpc/getAggregatedCollectionMetrics' from origin 'https://solanafloortracker.netlify.app' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

This may not be an issue since we are switching to Supabase for the data; however, we still use this resource for fetching the data to put into Supabase and may need to come up with an alternative data source (or create a scraper) if this will not work anymore.

phabreeze commented 2 years ago

I'm facing the same issue. The API appears to be sitting behind a Cloudflare proxy. This is what I think is happening --> https://stackoverflow.com/questions/70895179/axios-get-error-true-with-403-error-code

DavidReider commented 2 years ago

I believe the Magic Eden page is created with JavaScript on client-side rather than server side (so initially the browser will only contain an 'app' div and then will populate as their APIs respond, and then it is also served by Cloudflare...

I wonder if we are able to set up some sort of Puppeteer scraping instead if the API isn't publicly available for use anymore...

https://scrapingant.com/blog/puppeteer-tricks-to-avoid-detection-and-make-web-scraping-easier