nytimes-api
  • Welcome!
  • Documentation
    • Popular - mostEmailed
    • Popular - mostViewed
    • Popular - mostShared
    • Movies - allCritics
    • Movies - criticsPick
    • Movies - searchCritics
    • Movies - searchReviews
    • Books - bestSellersLists
    • Books - bestSellers
    • Books - overview
    • Books - searchReviews
    • TopStories - sections
    • TopStories - randomSection
    • TopStories - topStories
  • Examples
  • Changelogs
    • 1.0
    • 1.1
    • 1.2
    • 1.2.1
    • 1.3
Powered by GitBook
On this page
  • Example
  • What does it do?
  • Example Response
  1. Documentation

Popular - mostShared

Example

example.js
const { Popular } = require('nytimes-api');
const popular = new Popular('your-super-secret-api-key');

popular.mostShared(data => console.log(data[0]);

What does it do?

mostShared gets the most shared articles on the New York Times' website.

The code example above, however, only displays the most shared article rather than the most shared articles.

Example Response

example-response.json
{
  "url": "https://www.nytimes.com/interactive/2019/02/15/upshot/british-irish-dialect-quiz.html",
  "column": "",
  "section": "The Upshot",
  "byline": "By JOSH KATZ",
  "title": "The British-Irish Dialect Quiz",
  "abstract": "What does the way you speak say about where you’re from? Answer 25 questions to see your own custom dialect map.",
  "published_date": "2019-02-15",
  "source": "The New York Times",
  "asset_id": 100000006354694,
  "total_shares": 1,
  "des_facet": ["GEOGRAPHY"],
  "org_facet": ["ENGLISH LANGUAGE"],
  "per_facet": "",
  "geo_facet": ["IRELAND", "GREAT BRITAIN"],
  "media": [
    {
      "type": "image",
      "subtype": "photo",
      "caption": null,
      "copyright": null,
      "approved_for_syndication": 0,
      "media-metadata": [Array]
    }
  ]
}
PreviousPopular - mostViewedNextMovies - allCritics

Last updated 6 years ago