MENU

News Grabber Api

News Grabber Api is based on News Grabber Bot. The bot copies only essential things of news contents which are mainly title,image and inner content with published date.

How does it work

News Grabber bot crawls to supported sites on hourly basis and grabs news,the news is immediately formatted and inserted to database. Which is later used by the News Grabber Api.

News Grabber vs RSS

RSS feeds fetches everything except the news full content. News grabber grabs all news and their inner page contents giving you full readable news with no suspense watsoever.

Api Usage Rules

1)You must provide a link to the souce website where the news is grabbed from. Source url will be availabe in response onbject.

2)Do not send more than 1800 request/hour.

Api Usage

    
    //SIMPLE EXAMPLE using Jquery
    $.get("https://stillkonfuzed.com/NewsGrabber/grabber/getNews",(allNews)=>{
        //allNews = JSON.parse(allNews); //parse it if u get `Unexpected token` error
        if(allNews.status === 'news_found'){ //else returns `no_news`
            console.log(allNews); 
            console.log(allNews.newsData); //news data
            console.log(allNews.message); //number of news obtained.
            allNews.newsData.forEach((news)=>{
                $('body').append(news.news_title+"<\br>");
                $('body').append(`<\img src='${news.news_image}' width='200px'>`);
                $('body').append("<\br>"+news.news_content+"<\br>");
                //remove all escape (`\`) characters from above code
            });
                
        }else{
            //handle no data | allNews.status  === 'no_news'
            console.log(allNews.newsData); //news data will be null
            $('body').append("<\br>"+allNews.message+"<\br>");
        }
    });
    
    
    
    //News by id
    $.get("https://stillkonfuzed.com/NewsGrabber/grabber/getNewsById",{id:'1'},(allNews)=>{
        //allNews = JSON.parse(allNews); //parse it if u get `Unexpected token` error
        if(allNews.status === 'news_found'){ //else returns `no_news`
            console.log(allNews); 
            console.log(allNews.newsData); //news data
            console.log(allNews.message); //number of news obtained.
            allNews.newsData.forEach((news)=>{
                $('body').append(news.news_title+"<\br>");
                $('body').append(`<\img src='${news.news_image}' width='200px'>`);
                $('body').append("<\br>"+news.news_content+"<\br>");
                //remove all escape (`\`) characters from above code
            });
                
        }else{
            //handle no data | allNews.status  === 'no_news'
            console.log(allNews.newsData); //news data will be null
            $('body').append("<\br>"+allNews.message+"<\br>");
        }
    });
    
    

Cons

1 out of 100 images may appear broken for some news and will be auto replaced with a placeholder.jpg image.