Inshorts News

Inshorts News

News

The Inshorts-News-API, available on GitHub, is a tool that provides quick and easy access to news articles from Inshorts, a popular Indian news aggregator. With this API, you can retrieve news stories in a wide range of categories, including sports, politics, entertainment, and more. Whether you're a developer building a news app, a journalist researching a story, or just someone who wants to stay up-to-date on the latest news, the Inshorts-News-API is a valuable resource that can help you stay informed. So why not check it out today and start exploring the world of news?

Visit API

📚 Documentation & Examples

Everything you need to integrate with Inshorts News

🚀 Quick Start Examples

Inshorts News Javascript Examplejavascript
// Inshorts News API Example
const response = await fetch('https://github.com/cyberboysumanjay/Inshorts-News-API', {
    method: 'GET',
    headers: {
        'Content-Type': 'application/json'
    }
});

const data = await response.json();
console.log(data);

Introducing the Inshorts-News-API

The Inshorts-News-API is a public API that allows you to access news articles from various sources. With this API, you can retrieve the latest news articles in a matter of seconds. This API is open source and is available on GitHub.

API Endpoint

The endpoint for this API is: https://inshortsapi.vercel.app/news

API Endpoints Parameters

category : (optional) - Possible values are: "national", "business", "sports", "world", "politics", "technology", "startup", "entertainment", "miscellaneous", "hatke", "science", "automobile" (Default - top stories)

lang : (optional) - Language of articles to be returned. Possible values are: "en" and "hi". (Default - English)

apikey : (required) - An API key is needed to access this API. You can obtain a free API key by registering on the Inshorts API website.

Usage

To make use of the Inshorts-News-API, you need to send a GET request to the endpoint URL. Here's an example of how to retrieve the top stories in English:

const axios = require('axios');

const API_KEY = 'YOUR_API_KEY';

axios.get('https://inshortsapi.vercel.app/news',{
  headers: {
    "Authorization": API_KEY
    }
  }).then((response) => {
    console.log(response.data);
  }).catch((error) => {
    console.log(error);
  });

To retrieve articles based on any other category, simply pass the category parameter as shown below:

const axios = require('axios');

const API_KEY = 'YOUR_API_KEY';

axios.get('https://inshortsapi.vercel.app/news?category=sports',{
  headers: {
    "Authorization": API_KEY
    }
  }).then((response) => {
    console.log(response.data);
  }).catch((error) => {
    console.log(error);
  });

Similarly, to retrieve articles in Hindi, pass the lang parameter as shown below:

const axios = require('axios');

const API_KEY = 'YOUR_API_KEY';

axios.get('https://inshortsapi.vercel.app/news?lang=hi',{
  headers: {
    "Authorization": API_KEY
    }
  }).then((response) => {
    console.log(response.data);
  }).catch((error) => {
    console.log(error);
  });

Conclusion

In conclusion, the Inshorts-News-API is a great tool to access news articles in a fast and efficient manner. With a free API key, you can access articles from different news sources and various categories. The example code provided in this blog should help you get started with using the API in JavaScript.

📊 30-Day Uptime History

Daily uptime tracking showing online vs offline minutes

May 26May 28May 30Jun 1Jun 3Jun 5Jun 7Jun 9Jun 11Jun 13Jun 15Jun 17Jun 19Jun 21Jun 2404008001440Minutes
Online
Offline

Related APIs in News