Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bakedoatmeal/news-api-library

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bakedoatmeal/news-api-library

This news API library allows users to quickly get results from multiple different news APIs (NYT, Guardian, News API) in a standardized format.

  • 1.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

News API Library

This news API library allows users to quickly get results from multiple different news APIs (NYT, Guardian, News API) in a standardized format.

function getNews(apiKey, source)

Takes an apiKey object and a source string (’nyt’, ‘guardian’ or ‘’ for news API)

Returns a promise with the following data:

snippet: the abstract or snippet of an article

title: the article title

url: the link to the article on the original news site

image_url: a url to the preview image for the article

Alternatively, users can search use functions for each specific news API:

function getGuardian(apiKey)

Takes the Guardian API key as a string and returns a promise with the data formatted as described in the getNews() function.

function getNYT(apiKey)

Takes the NYT API key as a string and returns a promise with the data formatted as described in the getNews() function.

function getNewsAPI(apiKey)

Takes the NewsAPI api key as a string and returns a promise with the data formatted as described in the getNews() function.

FAQs

Package last updated on 05 Oct 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc