Reddit Scraper Lite avatar

Reddit Scraper Lite

Try for free

Pay $4.00 for 1,000 results

Go to Store
Reddit Scraper Lite

Reddit Scraper Lite

trudax/reddit-scraper-lite
Try for free

Pay $4.00 for 1,000 results

Pay Per Result, unlimited Reddit web scraper to crawl posts, comments, communities, and users without login. Limit web scraping by number of posts or items and extract all data in a dataset in multiple formats.

DK

CORS Error When Using API in React Application

Closed

dakster opened this issue
8 days ago

I am encountering a CORS error when trying to use the API in my React.js application.

The error message states: Access to XMLHttpRequest at 'https://api.apify.com/v2/actor-tasks/trudax/reddit-scraper-lite/runs?token=apify_api_token' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

This issue occurs when making an API call from the React frontend hosted locally on http://localhost:3000. It seems the API server does not allow requests from this origin due to CORS restrictions.

I have added the API call to my React application, but I am unable to proceed due to this error. Could you please guide me on how to resolve this or update the API to support CORS for local development?

trudax avatar

This is not an issue with the actor, so I cannot provide much guidance, but you probably need something like the /local-cors-proxy node package.

Developer
Maintained by Community

Actor Metrics

  • 380 monthly users

  • 68 stars

  • 78% runs succeeded

  • 12 hours response time

  • Created in Jun 2020

  • Modified a month ago