skip to Main Content

I am working on a study of social media during the 2016 campaign. We would like to leverage Twitter’s Search API to get the bulk of our data.

We believe there will be over 100 millions tweets with the keywords and would like to create a script to make the API call and store the information. If we follow Twitter’s rate limits of 450 requests per 15 minutes, will Twitter limit the number of queries we submit from our API key? Would it be possible to use GET search/tweets and obtain ALL tweets and related data posted during 2016 that have the words Hillary and Trump?

2

Answers


  1. Yes, Twitter will limit the number of queries submitted from your API key. It would be very difficult to obtain ALL of the tweets you are seeking to obtain.

    Rate limiting of the API is primarily on a per-user basis β€” or more
    accurately described, per user access token. If a method allows for 15
    requests per rate limit window, then it allows 15 requests per window
    per access token.

    When using application-only authentication, rate limits are determined
    globally for the entire application. If a method allows for 15
    requests per rate limit window, then it allows you to make 15 requests
    per window β€” on behalf of your application. This limit is considered
    completely separately from per-user limits.

    https://dev.twitter.com/rest/public/rate-limiting

    Look into using their Streaming API.

    Login or Signup to reply.
  2. If we follow Twitter’s rate limits of 450 requests per 15
    minutes, will Twitter limit the number of queries we submit from our
    API key?

    No, Twitter will not limit you if you follow the rate limits. With Twitter4j, you could ask Twitter how many queries you have left.

    Would it be possible to use GET search/tweets and obtain ALL
    tweets and related data posted during 2016 that have the words Hillary
    and Trump?

    No, it won’t be possible. As the documentation states:

    The Search API is not complete index of all Tweets, but instead an index of recent Tweets. At the moment that index includes between 6-9 days of Tweets.

    So, you can only get recent tweets from the search API. Be careful too with the data beacuse it’s about relevance not completeness, from the same documentation:

    Before getting involved, it’s important to know that the Search API is focused on relevance and not completeness. This means that some Tweets and users may be missing from search results. If you want to match for completeness you should consider using a Streaming API instead.

    If you really need older tweets you will have to get them from other sources like Gnip (you need to pay). Otherwise you will have to approach differently your problem.

    If you have the names (or id’s) of all the users that you want to get info you could get the timelines from each user getting up to 3200 tweets.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search