Create a cognitive news search app

This code pattern is part of the Watson Discovery learning path.

Level Topic Type
100 Introduction to Watson Discovery Article
101 Create a cognitive news search app Code pattern
201 Create an app to perform intelligent searches on data Code pattern
301 Get customer sentiment insights from product reviews Code pattern
401a Enhance customer helpdesks with Smart Document Understanding using webhooks in Watson Assistant Code pattern
401b Enhance customer helpdesks with Smart Document Understanding using the Watson Assistant search skill Code pattern


The web is home to massive amounts of data, with more being created every day. Organizations can harness this constant stream of information to gain understanding, plan strategies, and find opportunities. Enriched news data can help your application make dynamic connections across current events faster. In this code pattern, you’ll start with the basics and build your own news mining web application using JavaScript, Node.js, and the Watson Discovery Service. To do this, you’ll:

  • Use code that is written in Node.js, with the server-side using the Express framework and the client using ReactJS
  • Use the pre-built Watson Discovery News collection
  • Access the Watson Discovery Service through the Discovery API

Optionally, you can choose to host the app on IBM Cloud.


This code pattern shows you how to tap into massive data sets to mine insight. You’ll build a news mining web application with the Watson Discovery Service using the Watson Node.js SDK. The app demonstrates two use cases using Watson Discovery News:

  • Search: Query for the most relevant new articles about a specific topic or subject. Because the news collection is pre-enriched with natural language processing, you can query not just on keywords or categories but also on concepts, sentiment, and relations to get richer search responses.

  • Trending topics in the news: Identify popular topics over the past 24 hours. Topics can be general or specific to an industry or category.


create a cognitive news search app flow diagram

  1. The user interacts with the app UI to request relevant news content.
  2. The app sends user requests to Watson Discovery News.
  3. The Watson Discovery News Server sends user requests to the Watson Discovery Service.
  4. The Watson Discovery Service is continually crawling the web to update its Discovery News collection.


Ready to put this code pattern to use? Complete details on how to get started running and using this application are in the README.


This code pattern gave you some basic working knowledge of the Watson Discovery Service and showed you how to use Discovery along with JavaScript and Node.js to build your own news mining web application. The code pattern is part of the Learning Path: Getting started with Watson Discovery series. To continue the series and learn about more Watson Discovery Service features, take a look at the next code pattern, Use your own data to build a fully featured web app.



Related post