DEV Community

Cover image for API that converts Article to JSON
KetanIP
KetanIP

Posted on • Edited on

API that converts Article to JSON

Edit: Its free ( no limits) ( no Card needed ), feel free to play and experiment with it. You can find it at Rapid API Marketplace

Hello guys.

Today I'm happy to announce that I have launched a simple micro-saas application. My API helps you to convert any article be it a blog, news article or any thing to a well structured json document.

It will parse it and return its title, top image, authors, publish date, text, summary, videos, images, tags, keywords, and url.

Not only this but it also returns sentimental analysis of the text so you can use it forward in your application. So you can use the sentiments in your application.

You can find it at Rapid API Marketplace


var axios = require("axios").default;

var options = {
  method: 'GET',
  url: 'https://article-parser.p.rapidapi.com/',
  params: {
    website_url: 'https://www.washingtonpost.com/politics/2021/06/18/gops-gaslighting-biden-putin-trump/'
  },
  headers: {
    'x-rapidapi-key': 'YOUR_RAPID_API_KEY',
    'x-rapidapi-host': 'article-parser.p.rapidapi.com'
  }
};

axios.request(options).then(function (response) {
    console.log(response.data);
}).catch(function (error) {
    console.error(error);
});

Enter fullscreen mode Exit fullscreen mode

The parsed article returned is,

{
   "title":"The GOP’s gaslighting on Biden, Putin and Trump",
   "top_image":"https://www.washingtonpost.com/wp-apps/imrs.php?src=https://d1i4t8bqe7zgj6.cloudfront.net/06-16-2021/t_31136d8876b14fb0a02e726c1921b27e_name_biden_presser_0616_scaled.jpg&w=1440",
   "authors":[
      "Senior Reporter"
   ],
   "publish_date":"2021-06-18T00:00:00",
   "summary":"In their quest to pitch Biden as weak on Russia, Republicans are attacking pretty much everything they ignored about Trump.",
   "text":"Again: election interference. Again: human rights. Again: cyberattacks. Trump declined to focus on these things when he appeared with Putin. There was essentially nothing in his news conference geared toward holding “Russia accountable.” Biden might not have been as specific as some would have liked on things like human rights, but he at least brought them up and criticized Russia on them. Trump, by contrast, declined to and regularly suggested that the United States shouldn’t judge Russia’s human rights record.",
   "videos":[

   ],
   "images":[
      "https://www.washingtonpost.com/wp-apps/imrs.php?src=https://d1i4t8bqe7zgj6.cloudfront.net/06-16-2021/t_31136d8876b14fb0a02e726c1921b27e_name_biden_presser_0616_scaled.jpg&w=1440"
   ],
   "tags":[

   ],
   "keywords":[
      "gaslighting",
      "biden",
      "suggested",
      "united",
      "specific",
      "putin",
      "trump",
      "human",
      "declined",
      "russia",
      "rights",
      "states",
      "things",
      "gops"
   ],
   "url":"https://www.washingtonpost.com/politics/2021/06/18/gops-gaslighting-biden-putin-trump/",
   "sentimental_analysis":{
      "positive":0.085,
      "negative":0.038,
      "neutral":0.878,
      "overall":0.4767
   }
}
Enter fullscreen mode Exit fullscreen mode

Guys please let me know your experience with it. Hope you like it.

Top comments (0)