Skip to content

Latest commit

 

History

History
63 lines (43 loc) · 1.01 KB

File metadata and controls

63 lines (43 loc) · 1.01 KB

currentsapi

The official Node.js SDK for the Currents API.

Installation

npm install currentsapi

Usage

const CurrentsAPI = require('currentsapi');
const api = new CurrentsAPI('YOUR_API_KEY');

Endpoints

Latest News

api.latestNews({ language: 'en' })
  .then(response => console.log(response));

Search

api.search({ keywords: 'OpenAI', language: 'en' })
  .then(response => console.log(response));

Supported parameters:

  • keywords
  • language
  • country
  • category
  • start_date
  • end_date

Available Resources

api.availableLanguages();
api.availableRegions();
api.availableCategory();

Authentication

All requests are authenticated using an Authorization header. Pass your API key when instantiating the client:

const api = new CurrentsAPI('YOUR_API_KEY');

Get your API key at https://currentsapi.services/en/register.

License

MIT