newsdataapi

1.0.3 • Public • Published

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

  1. latest(params)

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

  1. archive(params)

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

  1. crypto(params)

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

  1. sources(params)

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

/newsdataapi/

    Package Sidebar

    Install

    npm i newsdataapi

    Weekly Downloads

    10

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    5.81 kB

    Total Files

    4

    Last publish

    Collaborators

    • arjun077
    • rohit-bytesview