Exploring, modeling, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

SAS VA Twitter Analytics

Occasional Contributor
Posts: 11

SAS VA Twitter Analytics

I'm trying out the Twitter analytics in SAS VA 7.3 and it appears when I access the twitter account, it only allows about a week's worth of data to be extracted. I don't see a place to put in a date range....any suggestions?

Trusted Advisor
Posts: 1,141

Re: SAS VA Twitter Analytics

Hi @ldenney, good question,


According to the SAS VA User Guide (http://support.sas.com/documentation/cdl/en/vaug/68648/HTML/default/viewer.htm#n1w05z0ghdc44fn1f0swt...) SAS VA application has the restrictions that the Twitter API has.


Note: Rate limits apply to the Twitter service. Such limits are beyond the control of SAS Visual Analytics. You are required to follow all applicable terms of use that Twitter and others might promulgate for Twitter data.

Therefore, even if you do this by code you might find similar results.


On a try to help you, I found this great information and discussion, provided by @FalkoSchulzhttp://blogs.sas.com/content/sascom/2013/12/12/how-to-import-twitter-tweets-in-sas-data-step-using-o...

This provides the way to import the Twitter data by code.


In the discussion below, I could find the following, textually:


Hi Sander,

The maximum number of tweets forhttps://api.twitter.com/1.1/search/tweets.json is 100 (API details are here). This blog entry was just a basic example to explain the general concept behind the authentication required as well as dealing with JSON results in SAS.

In order to get more than hundred tweets you would need to understand working with timelines (there is a guide with details). As a short summary you would introduce either a max_id parameter which specifies the max tweet ID you want to recieve - in other words you will get tweets older than this ID (there is also a since_id parameter which would return tweets younger than the one specified). In the past I was simply calling this macro x number of times in order to get multiple pages (each hundred tweets). On each call I'm appending the newly recieved tweets to a common tweet data set. I believe Twitter keeps about a one week history - so there is a natural limit how far back you can go. Initially you may have to run it a number of times - but in dialy or hourly batch job you may just have to deal with a few hundred dependent on your search term.

Hope this helps. Cheers, Falko


I hope to be able to help you a bit there.

Best regards,


Occasional Contributor
Posts: 11

Re: SAS VA Twitter Analytics

Hi Juan -

Thanks for your response. I will look into these suggestions.

Thanks for your help!
Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation