API Network Exploration: SummarizeBot

Welcome to our new monthly blog series on Postman's API Network. During these explorations I'll be discussing exciting and new entries into the network, as well as showing off some of their functionality.

This month I decided to look into one of our Data Management entries: SummarizeBot. SummarizeBot hosts a suite of tools for summary, analysis,  and classification of articles and web comments. They even do audio, video and image files! On top of all that, the API supports a broad range of languages so use cases are not limited to just the English speaking web.

The barrel of interesting applications for SummarizeBot's API is bottomless, so I've restrained myself to a few cool examples in this post. You can check out the rest of the collection in Postman by clicking the button below:

Run in Postman

 

Files or URLs? Why Not Both?

One of the most useful features in SummarizeBot's API is the implementation of GET and POST options for each endpoint. GET always expects to receive a URL where it can find content, whereas POST accepts a file in binary. This offers the flexibility to quickly test many different inputs on the same methods. Most APIs I have worked with require writing code to transform input into a more easily digestible format, so I was thrilled about this feature.

 

Learning From Mistakes

If you are running automated tests via Monitoring or have a large service that needs a lot of different calls to test, you might be sorting through thousands of different errors while debugging. What if we could get a high level summary of what's broken?

I used Joyce's tutorial on writing to file systems to write error logs from a Newman script to a local file. I'd unfortunately forgotten to set the environment for the collection I was experimenting with. This yielded three pretty basic errors:

  • {"error": "Sorry, something went wrong! Try another file."}
  • {"error":{"name":"instanceNotFoundError","message":"The specified environment does not exist."}}
  • {"errors":[{"code":215,"message":"Bad Authentication data."}]}

Making the most of the situation, I decided to run the error log through SummarizeBot's POST "/summarize" method with the "binary" option in Postman's Body tab, which lets us choose files to send to endpoints:

SummarizeBot identified the most frequent error with the highest weight, as well as with the second most. It did, however, leave the least frequent error ("Sorry, something went wrong! Try another file.") out of the return body. While it is correct to weight the least frequent (and least informative) error at the bottom, it would have been helpful to see that the error occurred.

This test shows that SummarizeBot does have an effective and powerful summarization tool, but that it may be better suited to analyzing natural language like news articles. That said, if I was looking at an error log several thousand lines long, I wouldn't hesitate to get the basic gist through SummarizeBot before diving in.

 

Getting Sentimental

SummarizeBot's "/sentiment" endpoint returns a list of sentiment "aspects" which are phrases rated either positively or negatively with a corresponding weight:The API also returns an overall rating for the entire body of text:

I thought this could be a valuable tool in figuring out how the internet feels about different topics, and what language people use to talk about them. So, I decided to test a page of Tweets mentioning @postmanclient. Big surprise, people like us!Here are some of the more highly rated aspects from the test:

 

 

 

 

If you get a bunch of twitter traffic and need to know how people are feeling, SummarizeBot is a quick way to find out. A more in depth application here might involve regularly calling the Twitter API to check on community sentiment. If something suddenly changed, the summarize function can show what has Twitter all excited.

I've barely scratched the surface of cool stuff you can do with SummarizeBot (did I mention they are powered by Blockchain?). Download their collection and sign up for a trial API key to do some exploration of your own!

 

 

Author: Paul

Peaked in 2013 after making a panini with slices of pizza instead of bread.