You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

newsdataapi

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

newsdataapi

React Hook for NewsData.io API

1.0.3
latest
npmnpm
Version published
Maintainers
1
Created
Source

NewsData.io React Client

A React hook-based wrapper for the NewsData.io API

🚀 Overview

newsdataapi is a lightweight, dependency-free React Hook client for accessing the NewsData.io API. It supports all available endpoints and handles validation, pagination, and parameter safety out of the box.

📦 Installation

npm install newsdataapi

📦 Usage

import useNewsDataApiClient from "newsdataapi";

const { latest, archive, crypto, sources } = useNewsDataApiClient("YOUR_API_KEY");

📦 Supported Endpoints

Each function accepts parameters as an object. All parameters are validated against NewsData.io Documentation

  • latest(params)

latest({ q: "ai", country: "us", language: "en" });

  • archive(params)

archive({ q: "elections", from_date: "2023-01-01", to_date: "2023-03-01" });

  • crypto(params)

crypto({ q: "bitcoin", coin: "btc"});

  • sources(params)

sources({ country: "us", language: "en" });

Keywords

news

FAQs

Package last updated on 30 May 2025

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