Skip to main content

MostPopularService

A list of all methods in the MostPopularService service. Click on the method name to view detailed information about that method.

MethodsDescription
get_emailed_period_jsonReturns an array of the most emailed articles on NYTimes.com for specified period of time (1 day, 7 days, or 30 days).
get_shared_period_jsonReturns an array of the most shared articles on NYTimes.com for specified period of time (1 day, 7 days, or 30 days).
get_shared_by_period_share_type_jsonReturns an array of the most shared articles by share type on NYTimes.com for specified period of time (1 day, 7 days, or 30 days).
get_viewed_period_jsonReturns an array of the most viewed articles on NYTimes.com for specified period of time (1 day, 7 days, or 30 days).

get_emailed_period_json

Returns an array of the most emailed articles on NYTimes.com for specified period of time (1 day, 7 days, or 30 days).

  • HTTP Method: GET
  • Endpoint: /emailed/{period}.json

Parameters

NameTypeRequiredDescription
periodGetEmailedPeriodJsonPeriodTime period: 1, 7, or 30 days.

Return Type

GetEmailedPeriodJsonOkResponse

Example Usage Code Snippet

from nyt_most_popular import NytMostPopular, Environment
from nyt_most_popular.models import GetEmailedPeriodJsonPeriod

sdk = NytMostPopular(
api_key="",
base_url=Environment.DEFAULT.value
)

result = sdk.most_popular.get_emailed_period_json(period=1)

print(result)

get_shared_period_json

Returns an array of the most shared articles on NYTimes.com for specified period of time (1 day, 7 days, or 30 days).

  • HTTP Method: GET
  • Endpoint: /shared/{period}.json

Parameters

NameTypeRequiredDescription
periodGetSharedPeriodJsonPeriodTime period: 1, 7, or 30 days.

Return Type

GetSharedPeriodJsonOkResponse

Example Usage Code Snippet

from nyt_most_popular import NytMostPopular, Environment
from nyt_most_popular.models import GetSharedPeriodJsonPeriod

sdk = NytMostPopular(
api_key="",
base_url=Environment.DEFAULT.value
)

result = sdk.most_popular.get_shared_period_json(period=1)

print(result)

get_shared_by_period_share_type_json

Returns an array of the most shared articles by share type on NYTimes.com for specified period of time (1 day, 7 days, or 30 days).

  • HTTP Method: GET
  • Endpoint: /shared/{period}/{share_type}.json

Parameters

NameTypeRequiredDescription
periodGetSharedByPeriodShareTypeJsonPeriodTime period: 1, 7, or 30 days.
share_typeShareTypeShare type: facebook.

Return Type

GetSharedByPeriodShareTypeJsonOkResponse

Example Usage Code Snippet

from nyt_most_popular import NytMostPopular, Environment
from nyt_most_popular.models import GetSharedByPeriodShareTypeJsonPeriod, ShareType

sdk = NytMostPopular(
api_key="",
base_url=Environment.DEFAULT.value
)

result = sdk.most_popular.get_shared_by_period_share_type_json(
period=1,
share_type="facebook"
)

print(result)

get_viewed_period_json

Returns an array of the most viewed articles on NYTimes.com for specified period of time (1 day, 7 days, or 30 days).

  • HTTP Method: GET
  • Endpoint: /viewed/{period}.json

Parameters

NameTypeRequiredDescription
periodGetViewedPeriodJsonPeriodTime period: 1, 7, or 30 days.

Return Type

GetViewedPeriodJsonOkResponse

Example Usage Code Snippet

from nyt_most_popular import NytMostPopular, Environment
from nyt_most_popular.models import GetViewedPeriodJsonPeriod

sdk = NytMostPopular(
api_key="",
base_url=Environment.DEFAULT.value
)

result = sdk.most_popular.get_viewed_period_json(period=1)

print(result)

Build Your Own SDKs with  liblab

Build developer friendly SDKs in minutes from your APIs

Start for Free →