plonknimbuzz
plonknimbuzz

Reputation: 2664

Can we get previous tweet using Twitter Streaming API?

I am working with Twitter REST API [PHP] for a month. Now I try STREAMING API because REST API has several downsides.

I use fennb/phirehose to work with Streaming API.

But after several trial and error, I realise that I can't got past/previous tweets using Streaming API.

The problem is, in programming and server, sometimes shit happen. Let's call it server down or lost internet connection. I will never get all previous tweet which posted when my server down. (I have 40 search term and more later).

So. i wanna ask:

  1. Can we get previous tweet using Streaming API?
  2. How to prevent/solve this case (console throw error, server restart, internet down, etc)?

Upvotes: 1

Views: 256

Answers (1)

anon
anon

Reputation:

Twitter's basic streaming API is realtime and about 1% of the actual firehouse of Tweets. You cannot retrieve older Tweets via the stream, and would need to fallback to the basic REST API to check for anything missed in the event of disconnection.

Twitter's enterprise data APIs include historical PowerTrack which can let you get older Tweets, as well as a replay capability in the event of disconnection, but these APIs are commercial.

Upvotes: 1

Related Questions