Create your own Slack bots — and web APIs — in R


One of Slack’s greatest appeals is that it’s so extensible. While its main purpose is group collaboration, add-on apps can do everything from to offer from tools like Jira and Trello.


And while there are dozens of pre-configured Slack bots from commercial third parties and open-source developers, it’s not difficult to code your own.

There are already tutorials on how to do this in and . But I wanted to take advantage of some R functions that easily import data about finance, weather, government information and more, and add some of that to what Slack calls “custom slash commands.” These allow users to get responses to queries with simple formats like /weather or /stockprice.

Here’s how I created a Slack custom slash command bot in R to retrieve current stock prices. The same techniques can be used for any other type of information you can import and process with R.