Capture 'track' filter in a variable



I am filtering tweets for 10 phones and want to tag each tweet with the keyword it was filtered for.

For example:

Tweet1: Iphone6plus is big
Tweet2: nexus5 launched recently

and the filter I am using is as follows:
twitterStream.filter(track=[‘nexus5’,‘iphone6plus’],languages = [‘en’])

Final result(on my local):
Tweet1: (‘iphone6plus is big’,‘iphone6plus’)
Tweet2: (‘Nexus5 launched recently’,‘nexus5’)

Can I capture the filter words for which the tweets were streamed?

Thanks for your help!


Currently this is not possible, as far as I know.


@shridharmanvi, ePirat is correct, you will have to post-process the Tweet text within your application. If you were strictly using hashtags you could look in the entities object.