0

I am trying to use the Viral Heat API in R for sentiment analysis. Directly hitting the browser with URL is returning proper results. http://www.viralheat.com/api/sentiment/review.json?text=i am happy&api_key=

Result: {"prob":0.6652067715019936,"mood":"positive","text":"i am happy"}

But when running from R, it is returning NULL

R code:

vh_answer = getURL("http://www.viralheat.com/api/sentiment/review.json?text=i%20am%20happy&api_key=<my key>")

What is the reason? Can anyone help please?

1 Answers1

0

Try putting a followlocation = TRUE in your getURL call.

I suspect you may also need to use cainfo = system.file("CurlSSL", "cacert.pem", package = "RCurl")), as well.

Thomas
  • 43,637
  • 12
  • 109
  • 140