This project has moved and is read-only. For the latest updates, please go here.

The Twitter limits the queries?

Jun 30, 2009 at 10:41 PM
I'm using LinqtoTwitter to see who I'm following. But he is not bringing all the people? What is happening?

Jun 30, 2009 at 10:50 PM

According to the Twitter API (, they only return 100 at a time. Are you following over 100 people?  If so, you can set the Page property, in the where clause, and loop through pages until your query doesn't return anymore values.


Jun 30, 2009 at 11:27 PM
Edited Jul 1, 2009 at 7:20 PM


In the query below  tweet has no property Page. Correct?

var users =
                  from tweet in twitterCtx.User
                  where tweet.Type == UserType.Followers &&
                        tweet.ID == twitterCtx.UserName   &&
                       tweet.Page= ??                    
                  select tweet

Jul 28, 2009 at 12:06 PM

Hey Joe,

Any answer regarding the latest question here? it seems that Page is only avaiable for SocialGraph table and not for the User table. Moreover, it seems that the SocialGraph.Page is redundent (I get all my 2000 without paging).



Jul 28, 2009 at 1:40 PM


I think this ChangeSet, or later, solves paging problems with User queries:


Jul 28, 2009 at 1:45 PM


I'll take a look at SocialGraph paging.


Jul 28, 2009 at 1:57 PM


I just looked at the Twitter API spec and they say that the page size for SocialGraph is 5000 ( This is a parameter you can't set. However, examining the impact, what you're getting back is only IDs.  Now that paging is working with User queries, will that work for you?


Jul 28, 2009 at 2:49 PM


Thanks for your propt reply!

> "Now that paging is working with User queries"

am I missing something? as far as I can tell ramonduraes's post above is correct - there is no Page propert for User table in V1.11, only for SocialGraph table. If there was - it would help, yes.

At the current state is I cannot see any way to retrieve more than 100 FRIST friends except for the socialgraph - which insufficient as you only get IDs. If there is one - could you provide a quick code sample?



Jul 28, 2009 at 7:04 PM


You can download the latest ChangeSet, which does have a Page property for User queries. I also added a GetFollowersDemo method to show how it works.


Mar 24, 2010 at 9:39 PM
Edited Mar 24, 2010 at 10:04 PM

I'm going like this:

private List<User> GetFollowers(string userID)
            var users = from tweep in _mainManager.GetTwitterContext().User
                        where tweep.Type == UserType.Followers &&
                              tweep.ID == userID &&
                              tweep.Page == 1
                        select tweep;
            List<User> result = users.ToList();
            var users2 = from tweep in _mainManager.GetTwitterContext().User
                         where tweep.Type == UserType.Followers &&
                              tweep.ID == userID &&
                              tweep.Page == 2
                        select tweep;
            return result;

And function returns only first hundred of users but twice. Though I have 116 followers. Is there an error in my code or a bug in LinqToTwitter?

Mar 26, 2010 at 4:45 AM
Edited Mar 26, 2010 at 4:46 AM

Hi Maxthegreatest,

The Page parameter is deprecated for certian User queries in Twitter, they just ignore it now. So, what you're seeing is the results as if you didn't use Page, which returns the first 100 users.  Instead, you should use cursors.  Here's an example:

        private static void UserFollowersQueryDemo(TwitterContext twitterCtx)
            int pageNumber = 1;
            string nextCursor = "-1";
            while (!string.IsNullOrEmpty(nextCursor) && nextCursor != "0")
                var users =
                    (from user in twitterCtx.User
                     where user.Type == UserType.Followers &&
                           user.ID == "15411837" &&
                           user.Cursor == nextCursor
                     select user)

                    "Page #" + pageNumber + " has " + users.Count + " users.");

                nextCursor = users[0].CursorMovement.Next;

Notice that I have a CursorMovement property on the User entity to help manage Previous and Next cursors. You start it off by setting the Cursor property of the user range variable to -1. Then use the Next property of CursorMovement to get the next set of results.  Every CursorMovement is the same, so you only need to look at the first one.


Mar 26, 2010 at 8:16 PM

Thnx for help. It's working:)