npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

wpnews

v1.2.1

Published

Official JavaScript/TypeScript SDK for the wpnews AI news API — 75 pre-built tools for AI agents

Readme

wpnews JavaScript / TypeScript SDK

Official JavaScript/TypeScript SDK for the wpnews AI news API.

  • Zero dependencies — uses native fetch (Node 18+, browsers, Deno, Bun, Cloudflare Workers)
  • Full TypeScript types — every response is typed
  • 71 pre-built news tools available via the REST API

Install

npm install wpnews
# or
pnpm add wpnews
# or
yarn add wpnews

Quick start

import { WPNews } from "wpnews";

const news = new WPNews({ apiKey: process.env.WPNEWS_API_KEY });

// Morning briefing — velocity status + hot articles + trending entities
const briefing = await news.getMorningBriefing();
console.log(briefing.velocity.status); // "burst" | "normal" | "quiet"
console.log(briefing.hot_articles[0].title);

// Search
const results = await news.search({ q: "OpenAI GPT-5", limit: 5 });

// Hot articles (breaking news radar)
const hot = await news.getHotArticles({ hours: 6, limit: 10 });

// Batch fetch by slug
const batch = await news.getArticlesBatch({
  slugs: ["openai-gpt-5-release", "anthropic-claude-4"],
});
console.log(`Found ${batch.found} of ${batch.requested} articles`);

Use with OpenAI function calling

import OpenAI from "openai";
import { WPNews } from "wpnews";

const client = new OpenAI();
const news = new WPNews({ apiKey: process.env.WPNEWS_API_KEY });

// Or load all 71 pre-built tool schemas directly
const tools = await fetch("https://api.wpnews.pro/api/v1/openai-tools.json").then(r => r.json());

const response = await client.chat.completions.create({
  model: "gpt-4o",
  messages: [{ role: "user", content: "What's the latest AI news?" }],
  tools,
  tool_choice: "auto",
});

Use with Vercel AI SDK

import { openai } from "@ai-sdk/openai";
import { generateText, tool } from "ai";
import { WPNews, type MorningBriefing } from "wpnews";
import { z } from "zod";

const news = new WPNews({ apiKey: process.env.WPNEWS_API_KEY });

const { text } = await generateText({
  model: openai("gpt-4o"),
  prompt: "What's the top AI news today?",
  tools: {
    getMorningBriefing: tool({
      description: "Get AI news velocity status, hot articles, and trending entities",
      parameters: z.object({ hours: z.number().optional() }),
      execute: async ({ hours }) => news.getMorningBriefing({ hours }),
    }),
    searchNews: tool({
      description: "Search AI news by keyword",
      parameters: z.object({ q: z.string(), limit: z.number().optional() }),
      execute: async ({ q, limit }) => news.search({ q, limit }),
    }),
  },
});

API reference

| Method | Endpoint | Description | |--------|----------|-------------| | getArticles(params?) | GET /api/v1/articles | Paginated article list | | search(params) | GET /api/v1/search | Full-text search | | getTopics(params?) | GET /api/v1/topics | Topics with article counts | | getHotArticles(params?) | GET /api/v1/articles/hot | Breaking news by freshness × quality | | getMorningBriefing(params?) | GET /api/v1/morning-briefing | Agent situational awareness | | getHourlyActivity(params?) | GET /api/v1/articles/hourly-activity | Publication rate time-series | | getArticlesBatch(params) | GET /api/v1/articles/batch | Fetch multiple articles by slug | | getTrendingEntities(params?) | GET /api/v1/entities/trending | Top entities by mention count | | getEntities(params?) | GET /api/v1/entities | All entities with counts | | getPulse(params?) | GET /api/v1/pulse | Ultra-compact (~50 tokens) status | | getNewsVelocity(params?) | GET /api/v1/news-velocity | Current vs baseline publication rate | | getDailyDigest(params) | GET /api/v1/digest/daily | Articles for a specific date |

Free tier

1,000 API calls/day free. No credit card required. Get your API key →

Or try keyless (rate-limited):

curl https://api.wpnews.pro/api/v1/morning-briefing

TypeScript

All response types are exported:

import type { Article, MorningBriefing, HourlyActivity, BatchResult } from "wpnews";

License

MIT