You could always poll the search API occasionally for a very common term like 'what' and just take the most recent tweet ID from that.
On Mar 3, 10:20 pm, Brian Morearty <bmorea...@gmail.com> wrote: > With the upcoming deprecation of /statuses/public_timeline that was > just announced, will there be any way to find out the (approximate) > highest tweet id? > > I know the streaming API would work but it seems like overkill. > > Scenario: in my app I cache tweets for performance and to avoid over- > calling the API. If someone references a tweet whose id doesn't exist > (e.g. by searching), I'd like to be able to tell the difference > between "that tweet was deleted" and "that tweet id has never been > used yet." > > I currently poll the public_timeline once every few minutes. Ids that > are missing but are lower than the highest one are considered > deleted. > > As you can see based on my current mechanism, exact precision doesn't > matter much to me. > > A better alternative for this use case would be a "deleted" indicator > (perhaps in the HTTP code?) if I try to retrieve a tweet that has been > deleted. It could be different than the code returned if a tweet had > never been created.