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 🙏

© 2024 – Pkg Stats / Ryan Hefner

newyorktimes

v0.0.2

Published

A Node.js wrapper for New York Times' API

Downloads

25

Readme

newyorktimes

A Node.js wrapper for New York Times' API.

var nyt = require('newyorktimes')(keys);

APIs


Article Search

Search Times articles from 1851 to today, retrieving headlines, abstracts and links to associated multimedia.

Best Sellers

Get data from all New York Times best-seller lists, including rank history for specific best sellers.

Campaign Finance

Get presidential campaign contribution and expenditure data based on United States Federal Election Commission filings.

Community

Get comments by NYTimes.com users.

Congress

Get U.S. Congressional vote data, including information about specific House and Senate members.

Districts

Get political districts based on a pair of coordinates. Currently, the Districts API is limited to New York City.

Event Listings

Get information about hand-picked events in New York City and the surrounding area.

Geographic

Use linked data to enhance location concepts used in The New York Times' controlled vocabulary.

Most Popular

Get links and metadata for the blog posts and articles that are most frequently e-mailed, shared and viewed by NYTimes.com readers.

Movie Reviews

Get links to reviews and NYT Critics' Picks, and search movie reviews by keyword.

Real Estate

Get aggregate data for real estate listings and sales in New York City.

Semantic

Get access to the people, places, organizations and descriptors that make up the controlled vocabulary used as metadata by The New York Times.

Times Newswire

Get links and metadata for Times articles in an up-to-the-minute stream.

Timestags

Get standardized terms that match your search query, and filter by Times dictionaries.

Quickstart

  • Reqest an API key: http://developer.nytimes.com/apps/register
  • View your keys at: http://developer.nytimes.com/apps/myapps
  • Create a file .env and format environment file with keys as in test.js
  • Follow the example

Example

Call the API url directly without needing to add the API key.

var keys = {
  article_search: 'API_KEY',
  best_sellers: 'API_KEY',
  campaign_finance: 'API_KEY',
  community: 'API_KEY',
  congress: 'API_KEY',
  districts: 'API_KEY',
  event_listings: 'API_KEY',
  geo: 'API_KEY',
  most_popular: 'API_KEY',
  movie_reviews: 'API_KEY',
  real_estate: 'API_KEY',
  semantic: 'API_KEY',
  times_newswire: 'API_KEY',
  timestags: 'API_KEY'
};
var nyt = require('newyorktimes')(keys);
nyt.query('http://api.nytimes.com/svc/semantic/v2/geocodes/query.json?country_code=US', function (err, json) {
  console.log(json);
});

Note: HTTPS works as well.

Tests

Run tests with

npm test