Hi, I’ve been a React based app for a project in university to run sentiment analysis algorithms on retrieved tweets.
I have been able to retrieve tweets outside of the browser when running code on it’s own just fine, but I haven’t been able to do so while using the browser, which is where I plan to eventually run the app.
I constantly run in CORS error like the one attached and I’m not sure what to do next. I have used GitHub - ttezel/twit: Twitter API Client for node (REST & Streaming API) to get Tweets. With and without any content filters and on different browsers, the output will be slightly different, but the main error is the no “Allow-control-allow-origin” error
Any ideas on how to overcome this issue? Or if I could implement the API in another way as to not involve CORS? If not for both, any recommendations on how I could implement a JS based app using the API that would work?
1 Like
Twitter API does not support CORS. You will have to implement your own server side API to talk to the browser. That way only your server side will talk to Twitter, not the browser client.
2 Likes
I see. I’ll look into that because I don’t want to scrap my project after all that. Been trying to get to the bottom of this for a few weeks now, thank you so much!
Have a great day!
1 Like
system
Closed
#4
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.