CloudObjects / Directory / The New York Times / Article Search API
Sign in

Article Search API

a wa:WebAPI in The New York Times

With the Article Search API, you can search New York Times articles from Sept. 18, 1851 to today, retrieving headlines, abstracts, lead paragraphs, links to associated multimedia and other article metadata. Note: In URI examples and field names, italics indicate placeholders for variables or values. Brackets [ ] indicate optional items. Parentheses ( ) are not a convention — when URIs include parentheses, interpret them literally.

Base URL

The API endpoint is located at the following URL:
https://api.nytimes.com/svc/search/v2

Authentication
API Methods

These are the methods supported by the API:

  • GET /articlesearch.json Article Search

    Article Search requests use the following URI structure:

    Optional parameters:
    q Search query term. Search is performed on the article body, headline and byline.
    fq "Filtered search query using standard Lucene syntax. The filter query can be specified with or without a limiting field: label. See Filtering Your Search for more information about filtering."
    begin_date "Format: YYYYMMDD Restricts responses to results with publication dates of the date specified or later."
    end_date "Format: YYYYMMDD Restricts responses to results with publication dates of the date specified or earlier."
    sort "By default, search results are sorted by their relevance to the query term (q). Use the sort parameter to sort by pub_date."
    fl "Comma-delimited list of fields (no limit) Limits the fields returned in your search results. By default (unless you include an fl list in your request), the following fields are returned: web_url snippet lead_paragraph abstract print_page blog source multimedia headline keywords pub_date document_type news_desk byline type_of_material _id word_count"
    hl Enables highlighting in search results. When set to true, the query term (q) is highlighted in the headline and lead_paragraph fields. Note: If highlighting is enabled, snippet will be returned even if it is not specified in your fl list."
    page "The value of page corresponds to a set of 10 results (it does not indicate the starting number of the result set). For example, page=0 corresponds to records 0-9. To return records 10-19, set page to 1, not 10."
    facet_field Comma-delimited list of facets Specifies the sets of facet values to include in the facets array at the end of response, which collects the facet values from all the search results. By default no facet fields will be returned. Below is the list of valid facets: section_name document_type type_of_material source day_of_week To learn more about using facets, see Using Facets.
    facet_filter When set to true, facet counts will respect any applied filters (fq, date range, etc.) in addition to the main query term. To filter facet counts, specifying at least one facet_field is required. To learn more about using facets, see Using Facets.
    Success response:

    The docs requested by the article search.

    Status Code 200
    
    
Meta
URI / COID
coid://nytimes.cloudobjects.io/ArticleSearch/V2
Revision
2-c52b5ca60bf1fe1103ba35afd864bf15
Last updated
2017-05-28 10:05 (UTC)
Created at
2017-08-20 05:51 (UTC)
Usage permission
co:Public