How to Create a Web Data Connector: A Beginner's Approach
When I joined Tableau, being a social media addict, in particular an Instagram fan, I wanted to analyse my social media data using Tableau. Come on, it is crucial to know the best time of day to post THIS awesome selfie.
So, I tried to get my Instagram data in Tableau. I googled “Tableau connection to Instagram”, but found no “out of the box” solution. I could not even export the data to Excel. I almost gave up but I then discovered the Web Data Connector option. A Web Data Connector allows you to connect to a world of data that is available over the web.
You should use a Web Data Connector when:
- Your data is outside of existing connectors
- Your data source does not have an existing ODBC driver
- Your data cannot be downloaded into a supported format
- You want to refresh your data frequently and automatically
The Tableau community already created many Web Data Connectors for different platforms, and shared them publicly. You can find them here. If you can find one already created, all you need to copy and paste the link into Tableau Desktop to connect to your data. At that time though, I could not find one for Instagram.
The barman controls the drinks as the API controls the data. The barman is the only access that you have to the drinks, and the API is the only point of access to your data. The API sends back the data you asked for, in the same way the barman serves you the drinks you want according to their recipes.
Once you have fulfilled all the requirements, you can find in the SDK some code samples. My advice is not to start your WDC from scratch, but from a pre-built one. For instance, you can use the earthquake WDC as a template for your custom code.
In the SDK, you also have a simulator that allows you to test your WDC before trying it in Tableau. It is very useful. In order to debug, you can add a debug line console.log().
Once everything works fine in the simulator, you can use it in Tableau.
My advice: start with an easy API that does not require authentication or an API key. My favourite one is Swapi, the Star Wars API.
As you now understand, I am a social media addict and I use the Facebook and Twitter Web Data Connectors often. As of now, there is no Snapchat WDC yet, but it is one that I would like to develop!
Apart from creating WDCs, I like to play with the data in my free time. I recently created a visualisation using the Instagram WDC for a colleague who is a huge fan of the Kardashians, and this visualisation that looks at Trump’s Instagram:
We not only have social media WDCs, we also have a movies' one. The next visualisation is using a TMDb – themoviedb.org WDC created by my colleague Michele Tessari.
Web Data Connectors are a great option. You can get the value of your data into Tableau. You do not need to be a software engineer to build your own, having “Google developer” skills is enough, once you understand the basics and master your API.