APIful Blog We're obsessed with Web APIs


Learning How to Invoke IBM Alchemy Data News Through API Harmony

Nov 9, 2016 •

Many developers use an example-driven approach when looking for resources to learn or even remind themselves on how to invoke a web API. Nobody these days tends to sit down and go through an offical reference documentation page after page. While searching for Stack Overflow posts is very useful, sometimes you want to see how a particular invocation in the context of a real application. However, using GitHub search to find such applications can be frustrating, because GitHub search, being a keyword search, does not understand the semantics of code to always return sensible results.

A couple of days ago I just encountered something cool generated by our lessons learned feature in API Harmony, powered by Big Code Analysis, that I want to share with you.

The Alchemy Data News API “provides news and blog content enriched with natural language processing to allow for highly targeted search and trend analysis.” You can invoke this service via the GetNews endpoint. Officially, there are 12 query parameters. The lessons learned in API Harmony highlight three that are frequently used in other code found in GitHub: apikey, count, and end. All of these three fields were used 6 out of 7 times when the GetNews endpoint was invoked.



Lessons from Github on the Alchemy Data News API

As I’m new to Alchemy Data News API myself, what caught my eye was that the end query parameter was frequently set to now, a value that seems quite specific to this API that I wouldn’t have known.

To see the context of how other people also make this call, API Harmony picks out three examples. Clicking one of these example links brings you right to the GitHub source code the lessons are extracted from.



Showing the source code for the context of how the API is being invoked.

What other information would you as a developer find it a good lesson learned? Can you share a good lesson learned that perhaps tripped you up before?

Share via a Tweet or follow us for everything APIs!