Sample App – IBM Insights for Twitter Service on Bluemix

Share this post:

As I was working on SOmusic, I experimented with the Insights for Twitter test application provided to define the queries I would be using and to understand the result format:


It got the job done, but as I was going back and forth in the documentation of the query language, I thought we could have a more complete search user interface. Step 1 of my solution is shown below:

The interface uses the impressive jQuery QueryBuilder plugin to visually assemble the query. The experts can directly use the “Raw Query” field type but the uninitiated can pick fields from the list. Each field has a description you can display by pressing the blue “i” button. The plugin supports creating nested queries so that you can build more complex searches combining AND/OR groups.

Once the query is defined, use the Twitter Search button to get a subset of the results:

Of course you can deploy the app in your own Bluemix account and tweak the code if you want to get more results here. Step 3 shows the tweets:

Select a tweet to view its details in Step 4; this uses the Twitter oEmbed API:

In both steps 3 and 4, you can switch to the Source tab to view the raw JSON data. Step 5 in the UI shows the Insights for Twitter enrichments. You can query these fields in the search, making this a great way to tailor the results to your needs:

In Step 6, you can copy a link that embeds the query definition, so that you can pass it to a friend or bookmark it:

For sake of completeness, below is a full screenshot showing the 1-6 steps above (click to enlarge):

The source code is posted at IBM-Bluemix/insights-search on GitHub. A sample version is deployed at but you can use the Deploy button below to deploy it to your own Bluemix account:

Deploy Insights Search application to your Bluemix account

If you have comments on the user interface or would like to suggest improvements, please reply below!

Offering Manager - IBM Cloud

More stories
May 1, 2019

Two Tutorials: Plan, Create, and Update Deployment Environments with Terraform

Multiple environments are pretty common in a project when building a solution. They support the different phases of the development cycle and the slight differences between the environments, like capacity, networking, credentials, and log verbosity. These two tutorials will show you how to manage the environments with Terraform.

Continue reading

April 29, 2019

Transforming Customer Experiences with AI Services (Part 1)

This is an experience from a recent customer engagement on transcribing customer conversations using IBM Watson AI services.

Continue reading

April 26, 2019

Analyze Logs and Monitor the Health of a Kubernetes Application with LogDNA and Sysdig

This post is an excerpt from a tutorial that shows how the IBM Log Analysis with LogDNA service can be used to configure and access logs of a Kubernetes application that is deployed on IBM Cloud.

Continue reading