Git Product home page Git Product logo

inshorts-api's Introduction

Inshorts News Content Scraper ๐Ÿ“ฐ


Inshorts is an app which provides news from different sources and presents them under 60 words. This is an application which scapers the content from the inshort's website and then serves it via differnet endpoints. You can fetch news from multiple different sources as gathered by the inshorts platform.


๐Ÿ—ƒ๏ธ News Categories

This API supports category wise news. Here is a complete list of all categories.

  1. All
  2. National //Indian News only
  3. Business
  4. Sports
  5. World
  6. Politics
  7. Technology
  8. Startup
  9. Entertainment
  10. Science
  11. Automobile
  12. Hatke
  13. Miscellaneous

You can check all the API endpoints here https://inshot.herokuapp.com/


๐Ÿ” Usage

Make a GETrequest to the required API endpoint to get the corresponding news in JSON format

https://inshot.herokuapp.com/v1/{category}

Example - https://inshot.herokuapp.com/v1/all


Response Format

The response JSON Object looks something like this -

{
  "category": "all",
    "totalArticles": "51",
    "data": [
        {
            "title": "Will send them tractor: Sonu Sood after farmer forced to use daughters to plough",
            "description": "Sonu Sood has offered help to a farmer, who was forced to use his daughters instead of oxen to pull plough in his fields because of financial crisis due to lockdown in Andhra Pradesh. Sonu first wrote, \"Tomorrow...he'll have a pair of ox.\" \"This family doesn't deserve a pair of ox...They deserve a tractor...Sending you one,\" he later tweeted.",
            "author": "Daisy Mowke",
            "inshortsLink": "https://inshorts.com/en/news/will-send-them-tractor-sonu-sood-after-farmer-forced-to-use-daughters-to-plough-1595763592426",
            "image": "https://static.inshorts.com/inshorts/images/v1/variants/jpg/m/2020/07_jul/26_sun/img_1595762605384_174.jpg?",
            "timeStamp": "2020-07-26T11:39:52.000Z",
            "readMore": "https://m.hindustantimes.com/bollywood/sonu-sood-changes-mind-about-sending-oxen-to-farmer-using-his-daughters-to-plough-fields-they-deserve-a-tractor-sending-one/story-XFkJ9fiDcLdeuYLzPa6v7M_amp.html?utm_campaign=fullarticle&utm_medium=referral&utm_source=inshorts"
        },
        {
            "title": "You won Oscar, you have more talent than B'wood can handle: Shekhar to Rahman",
            "description": "After singer-composer AR Rahman said that there is a gang spreading rumours about him in Bollywood, filmmaker Shekhar Kapur tweeted, \"You know what your problem is @arrahman? You went and got #Oscars.\" He added, \"An Oscar is the kiss of death in Bollywood. It proves you have more talent than Bollywood can handle.\"",
            "author": "Anmol Sharma",
            "inshortsLink": "https://inshorts.com/en/news/you-won-oscar-you-have-more-talent-than-bwood-can-handle-shekhar-to-rahman-1595767354287",
            "image": "https://static.inshorts.com/inshorts/images/v1/variants/jpg/m/2020/07_jul/26_sun/img_1595766665111_85.jpg?",
            "timeStamp": "2020-07-26T12:42:34.000Z",
            "readMore": "https://twitter.com/shekharkapur/status/1287311995230801920?utm_campaign=fullarticle&utm_medium=referral&utm_source=inshorts"
        },
  ]
}

๐Ÿ‘ท Setup

This API is created using puppeteer. You can also use this with serverless funtions such as Vercel or AWS Lambda functions

Run locally

  • Clone the Repo
$ git clone https://github.com/bijankundu/Inshorts-Api.git

$ cd Inshorts-news-api
  • Install the dependencies
npm install
  • Run the API
node index.js

NOTE: The data is scraped from the official website of Inshorts, so the response time of endpoints might be slow. The endpoint is deprecated, will update with new endpoint soon

๐Ÿšจ๐Ÿšจ๐Ÿšจ DISCLAIMER: The application is for education purpose only. The content is copyrighted by the orginal author/company and isn't recommended for commercial use.


inshorts-api's People

Contributors

bijankundu avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.