Skip to content

Latest commit

 

History

History
100 lines (83 loc) · 2 KB

README.md

File metadata and controls

100 lines (83 loc) · 2 KB

Current Affairs API

This API provides the Current Affairs of India and International News and daily quizzes for practicing your skills on current affairs.

Features:

  1. International current affairs
  2. India’s current affairs
  3. Quiz for today
  4. Today in Indian History
  5. Current affair for any day ( dev )

Installation

npm install

Endpoints:

  1. /international-today
const axios = require('axios');

const options = {
  method: 'GET',
  url: 'https://current-affairs-of-india.p.rapidapi.com/international-today',
  headers: {
    'X-RapidAPI-Key': 'your-rapidapi-key',
    'X-RapidAPI-Host': 'current-affairs-of-india.p.rapidapi.com'
  }
};

try {
	const response = await axios.request(options);
	console.log(response.data);
} catch (error) {
	console.error(error);
}
  1. /recent
const axios = require('axios');

const options = {
  method: 'GET',
  url: 'https://current-affairs-of-india.p.rapidapi.com/recent',
  headers: {
    'X-RapidAPI-Key': 'your-rapidapi-key',
    'X-RapidAPI-Host': 'current-affairs-of-india.p.rapidapi.com'
  }
};

try {
	const response = await axios.request(options);
	console.log(response.data);
} catch (error) {
	console.error(error);
}
  1. /today-quiz
const axios = require('axios');

const options = {
  method: 'GET',
  url: 'https://current-affairs-of-india.p.rapidapi.com/today-quiz',
  headers: {
    'X-RapidAPI-Key': 'your-rapidapi-key',
    'X-RapidAPI-Host': 'current-affairs-of-india.p.rapidapi.com'
  }
};

try {
	const response = await axios.request(options);
	console.log(response.data);
} catch (error) {
	console.error(error);
}
  1. /history-of-today
const axios = require('axios');

const options = {
  method: 'GET',
  url: 'https://current-affairs-of-india.p.rapidapi.com/history-of-today',
  headers: {
    'X-RapidAPI-Key': 'your-rapidapi-key',
    'X-RapidAPI-Host': 'current-affairs-of-india.p.rapidapi.com'
  }
};

try {
	const response = await axios.request(options);
	console.log(response.data);
} catch (error) {
	console.error(error);
}