Git Product home page Git Product logo

inshorts-api-v2's Introduction

๐Ÿ“ฐ Inshorts News API v2

This is the v2 for my previous Inshorts News API. You can check out the v1 here.

โœจ Features

  • ๐Ÿš€ Blazing fast
  • ๐Ÿ“„ 18 different categories to choose from
  • ๐Ÿšง Ability to limit the number of results per page.
  • ๐Ÿ“ฆ Host your own instance on vercel with a click of a button.

๐Ÿ—ƒ๏ธ News Categories

Here is a complete list of all the supported categories.

  1. all_news
  2. trending
  3. top_stories
  4. national
  5. business
  6. politics
  7. sports
  8. technology
  9. startups
  10. entertainment
  11. hatke
  12. education
  13. world
  14. automobile
  15. science
  16. travel
  17. miscellaneous
  18. fashion

๐Ÿ” Usage

You can use either of the categories from News Categories

Base endpoint : https://inshortsv2.vercel.app/news

Make a GETrequest to the Base endpoint with the name of the category to get the corresponding news in JSON format

https://inshortsv2.vercel.app/news?type={category name}

Example - https://inshortsv2.vercel.app/news?type=all_news

To limit the number of results per page, add {limit} at the end of the API url.

Example - https://inshortsv2.vercel.app/news?type=all_news&limit=23

  • This will limit the results to 23 for that request.

NOTE : If no limit is provided, default limit is set to 10 results per page.


# Response Format

The response JSON Object looks something like this -

{
  "total": 2,
  "articles": [
    {
      "title": "Gujarat government will soon bring in law against 'love jihad': CM",
      "description": "Gujarat CM Vijay Rupani said on Sunday that the BJP-led state government will soon introduce law against 'love jihad'. \"The manner in which girls are being lured, won't go on for long,\" he added at a poll rally in Vadodara. BJP-led governments in UP and Madhya Pradesh have already brought in similar laws against conversion through fraudulent means or marriage.",
      "author_name": "Sharangee Dutta",
      "source_name": "Twitter",
      "source_url": "https://twitter.com/ANI/status/1361163467600789504?utm_campaign=fullarticle&utm_medium=referral&utm_source=inshorts",
      "image_url": "https://static.inshorts.com/inshorts/images/v1/variants/jpg/m/2021/02_feb/15_mon/img_1613372177248_930.jpg?",
      "created_at": 1613373403000,
      "inshorts_url": "https://shrts.in/7gCM"
    },
    {
      "title": "Pujara loses grip of bat and gets run out after it slips out of his hand",
      "description": "India batsman Cheteshwar Pujara got run out on sixth delivery of the third day of the second Test against England. The 33-year-old flicked a delivery to the short leg fielder, who threw the ball back to the keeper. Pujara failed to reach the crease in time as he lost the grip of his bat, which slipped out of his hand.",
      "author_name": "Anmol Sharma",
      "source_name": "CricTracker",
      "source_url": "https://www.crictracker.com/india-vs-england-cheteshwar-pujara-drops-his-bat-gets-run-out-in-bizarre-fashion/?amp=&utm_campaign=fullarticle&utm_medium=referral&utm_source=inshorts",
      "image_url": "https://static.inshorts.com/inshorts/images/v1/variants/jpg/m/2021/02_feb/15_mon/img_1613371011546_262.jpg?",
      "created_at": 1613373231000,
      "inshorts_url": "https://shrts.in/ZmZH"
    },
  ]
}

๐Ÿ‘ท Local development

Prerequisites

  • NodeJS v10+
  • Vercel CLI : To install Vercel CLI globally use npm i -g vercel

Run locally

  • Clone the Repo

    $ git clone https://github.com/sumitkolhe/inshorts-api-v2
    
    $ cd inshorts-api-v2
    
  • Install the dependencies

    npm install
    
  • Start development server

    npm start
    
  • Deploy to your vercel account

    npm run deploy
    

๐Ÿš€ Deploy to Vercel

You can directly deploy this repo to your Vercel account by clicking the button below.

Deploy with Vercel

inshorts-api-v2's People

Contributors

sumitkolhe avatar

Watchers

James Cloos avatar  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.