Paging of user/dashboard with since_id and limit

708 views
Skip to first unread message

Mahesh Asolkar

unread,
Jul 18, 2011, 7:22:53 PM7/18/11
to tumbl...@googlegroups.com
Greetings,

I am trying to follow documentation of user/dashboard method (http://www.tumblr.com/docs/en/api/v2#user-methods) to retrieve posts in multiple pages. I first get the initial page:

  user/dashboard?limit=20

This gives me posts, say, from id=7777239254 to id=7750311392. Then I use 'since_id' to get the next 20 posts, like so:

  user/dashboard?limit=20&since_id=7750311391

This returns me the same list of posts from page 1. Which is logical, since user/dashboard is returning 20 posts 'since' the id 7750311391, that is, 20 posts 'newer than' id 7750311391. Shouldn't user/dashboard return 20 posts 'older than' the 'since_id'. In which case it would be 'max_id' rather than 'since_id'. That is how it works in Twitter API (https://dev.twitter.com/docs/api/1/get/statuses/home_timeline).

Am I misreading something? If someone has successfully used paging with Tumblr API v2, can they guide me please?

Thanks,
Mahesh.

Mahesh Asolkar

unread,
Jul 19, 2011, 8:26:45 PM7/19/11
to tumbl...@googlegroups.com
Just to clarify, I am starting with the latest post (maximum ID value) and fetching older posts (ID values less than latest post) as required in multiple pages. I did not mention this since I would think this is the normal mode.

/Mahesh

Steven Pears

unread,
Aug 11, 2011, 10:12:17 AM8/11/11
to Tumblr API Discussion
Mahesh

If you want to get the second page, you would use the offset value, so
you'd end up with limit=20&offset=20 - which works fine.

The useful nature of since_id is for apps that have a local cache,
such as on a phone. In this situation we can use the latest post we
have in our local cache as the since_id, and tumblr can then ensure we
don't get sent data we already have by only returning new content -
this then reduces traffic, app performance and potentially data
charges to the user.

Hope this helps clear things up a bit

Steven

sean808080

unread,
Jan 7, 2012, 2:13:42 PM1/7/12
to tumbl...@googlegroups.com
Steven & Manesh:

Thanks for clarifying.  Unfortunately, I'm still somewhat fuzzy. :-)

When I see this (as posted on the TUMBLR api ref):
since_idNumberReturn posts that have appeared after this ID
Use this parameter to page through the results: first get a set of posts, and then get posts since the last ID of the previous set.

It makes me think that since_id is to get posts that are "newer" than the id passed.  

Do we in fact, need to past a since_id in order to page through older posts?  Can someone fill in the full params needed to page though posts?

Thanks in advance,
Sean



Max Kaplan

unread,
Feb 23, 2012, 4:44:05 PM2/23/12
to tumbl...@googlegroups.com
I'm still really confused to. What is the best way get the previous page?

So if page one have ID=90 to ID 100.

I want to get ID=80 to 89.

But when I do:

http://api.tumblr.com/v2/user/dashboard?since_id=90&offset=10&limit=10

I get a 200 but no posts in the response.

Steven Pears

unread,
Feb 23, 2012, 7:05:57 PM2/23/12
to tumbl...@googlegroups.com
Since_id is only useful when checking for new posts. Tumblr, as far as I know, have no twitter-style max_id field, which is what's required for accurate paging.

Offset without a since_id is the only way I've found it works well enough.

Steven

Sent from my Windows Phone

From: Max Kaplan
Sent: 23/02/2012 21:44
To: tumbl...@googlegroups.com
Subject: Re: Paging of user/dashboard with since_id and limit

Federico Erostarbe

unread,
Feb 23, 2012, 7:07:35 PM2/23/12
to tumbl...@googlegroups.com
And, to tell the truth, almost everything regarding paging works like hell.

-- 
Federico Erostarbe

Reply all
Reply to author
Forward
0 new messages