Building Twitter Powered Vending Machine (Using Raspberry Pi)


H, I’m looking to have a system built, that allows a vending machine to give out free products when a user ‘tweets’ a specific hashtag, using a Raspberry Pi.

I’m not a developer (as you my have guessed), but to keep costs down I’ve been asked to supply all the details regarding the rules and policies for the API integration, etc, for creating something like this.

Essentially the user will go through their Twitter app and take a photo, upload it with the relevant hashtag and we then automatically send them a unique code to be used on the machine.

Anyone advice from anyone who has done something similar would be great.

Thank you


Maybe worth requiring that participants also follow an account you control. That way you can use DMs to send out codes to people who opt in. (Make sure your application has the right access tokens in

Have a look at the filter stream - where you get a live feed of every tweet that matches a specific hashtag:

You’ll have to do additional filtering on qualifying tweets your self though (whether or not tweet contains a correct photo for example)


I’ve seen a bunch of these vending machines (in fact we used to have one in the Twitter office where I work) and this is fairly straightforward. You’d want to have the participants use a hashtag or other unique value you can search for in the streaming API filter. As @IgorBrigadir says you could also use DMs and have the user follow you for a code.


Igor thank you very much, this is really very helpful!

For the brands we are working with, encouraging customers to follow them on Twitter and share a message (with the campaign hashtag) is ideal.

I will relay this to the developer and can get going with the project, really appreciate the advice.


Thanks Andy, that’s great. I was just wondering if we had to go through any process with Twitter to be allowed to do something like this.

I know with Instagram it’s very difficult to run similar projects and you must apply to work with them.

Thanks again for your advice.


I’d definitely encourage you to be aware of our rules related to automation. Other than that, I don’t foresee too many issues if you think about how you’re building it carefully.