/nytimes/articles/search
curl --request POST \
--url https://api.anysite.io/api/nytimes/articles/search \
--header 'Content-Type: application/json' \
--header 'access-token: <api-key>' \
--data '
{
"count": 550,
"timeout": 300,
"keyword": "",
"types": [
"article",
"athleticarticle",
"audio",
"carddeck",
"interactive",
"legacycollection",
"paidpost",
"recipe",
"slideshow",
"video",
"wirecutterarticle"
],
"sort": "best",
"language": "en",
"start_date": "<string>",
"end_date": "<string>"
}
'import requests
url = "https://api.anysite.io/api/nytimes/articles/search"
payload = {
"count": 550,
"timeout": 300,
"keyword": "",
"types": ["article", "athleticarticle", "audio", "carddeck", "interactive", "legacycollection", "paidpost", "recipe", "slideshow", "video", "wirecutterarticle"],
"sort": "best",
"language": "en",
"start_date": "<string>",
"end_date": "<string>"
}
headers = {
"access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
count: 550,
timeout: 300,
keyword: '',
types: [
'article',
'athleticarticle',
'audio',
'carddeck',
'interactive',
'legacycollection',
'paidpost',
'recipe',
'slideshow',
'video',
'wirecutterarticle'
],
sort: 'best',
language: 'en',
start_date: '<string>',
end_date: '<string>'
})
};
fetch('https://api.anysite.io/api/nytimes/articles/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.anysite.io/api/nytimes/articles/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'count' => 550,
'timeout' => 300,
'keyword' => '',
'types' => [
'article',
'athleticarticle',
'audio',
'carddeck',
'interactive',
'legacycollection',
'paidpost',
'recipe',
'slideshow',
'video',
'wirecutterarticle'
],
'sort' => 'best',
'language' => 'en',
'start_date' => '<string>',
'end_date' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.anysite.io/api/nytimes/articles/search"
payload := strings.NewReader("{\n \"count\": 550,\n \"timeout\": 300,\n \"keyword\": \"\",\n \"types\": [\n \"article\",\n \"athleticarticle\",\n \"audio\",\n \"carddeck\",\n \"interactive\",\n \"legacycollection\",\n \"paidpost\",\n \"recipe\",\n \"slideshow\",\n \"video\",\n \"wirecutterarticle\"\n ],\n \"sort\": \"best\",\n \"language\": \"en\",\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.anysite.io/api/nytimes/articles/search")
.header("access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"count\": 550,\n \"timeout\": 300,\n \"keyword\": \"\",\n \"types\": [\n \"article\",\n \"athleticarticle\",\n \"audio\",\n \"carddeck\",\n \"interactive\",\n \"legacycollection\",\n \"paidpost\",\n \"recipe\",\n \"slideshow\",\n \"video\",\n \"wirecutterarticle\"\n ],\n \"sort\": \"best\",\n \"language\": \"en\",\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anysite.io/api/nytimes/articles/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"count\": 550,\n \"timeout\": 300,\n \"keyword\": \"\",\n \"types\": [\n \"article\",\n \"athleticarticle\",\n \"audio\",\n \"carddeck\",\n \"interactive\",\n \"legacycollection\",\n \"paidpost\",\n \"recipe\",\n \"slideshow\",\n \"video\",\n \"wirecutterarticle\"\n ],\n \"sort\": \"best\",\n \"language\": \"en\",\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body[
{
"uri": "<string>",
"asset_type": "<string>",
"document_title": "<string>",
"@type": "NytimesAsset",
"document_type": "<string>",
"web_url": "<string>",
"alias": "<string>",
"seo_title": "<string>",
"sub_headline": "<string>",
"kicker": "<string>",
"summary": "<string>",
"promotional_headline": "<string>",
"promotional_summary": "<string>",
"published_at": 123,
"updated_at": 123,
"word_count": 123,
"tone": "<string>",
"desk": "<string>",
"language": "<string>",
"section": {
"name": "<string>",
"@type": "NytimesSectionRef",
"uri": "<string>",
"display_name": "<string>",
"web_url": "<string>"
},
"subsection": {
"name": "<string>",
"@type": "NytimesSectionRef",
"uri": "<string>",
"display_name": "<string>",
"web_url": "<string>"
},
"authors": [],
"byline": "<string>",
"image": {
"image": "<string>",
"@type": "NytimesImage",
"uri": "<string>",
"width": 123,
"height": 123,
"caption": "<string>",
"credit": "<string>",
"alt_text": "<string>"
},
"tags": [],
"related": [],
"duration_seconds": 123
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}/nytimes
/nytimes/articles/search
Search everything The New York Times has published since 1851 — news and opinion articles, videos, interactives, slideshows, audio, recipes, The Athletic and Wirecutter pieces, paid posts and card decks. Filter by kind of item, section, publication day range and language edition, and order by relevance, newest or oldest. Each result carries headline, summary, kicker, authors, section, topic tags, lead image and publication times.
Price: 1 credit
POST
/
api
/
nytimes
/
articles
/
search
/nytimes/articles/search
curl --request POST \
--url https://api.anysite.io/api/nytimes/articles/search \
--header 'Content-Type: application/json' \
--header 'access-token: <api-key>' \
--data '
{
"count": 550,
"timeout": 300,
"keyword": "",
"types": [
"article",
"athleticarticle",
"audio",
"carddeck",
"interactive",
"legacycollection",
"paidpost",
"recipe",
"slideshow",
"video",
"wirecutterarticle"
],
"sort": "best",
"language": "en",
"start_date": "<string>",
"end_date": "<string>"
}
'import requests
url = "https://api.anysite.io/api/nytimes/articles/search"
payload = {
"count": 550,
"timeout": 300,
"keyword": "",
"types": ["article", "athleticarticle", "audio", "carddeck", "interactive", "legacycollection", "paidpost", "recipe", "slideshow", "video", "wirecutterarticle"],
"sort": "best",
"language": "en",
"start_date": "<string>",
"end_date": "<string>"
}
headers = {
"access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
count: 550,
timeout: 300,
keyword: '',
types: [
'article',
'athleticarticle',
'audio',
'carddeck',
'interactive',
'legacycollection',
'paidpost',
'recipe',
'slideshow',
'video',
'wirecutterarticle'
],
sort: 'best',
language: 'en',
start_date: '<string>',
end_date: '<string>'
})
};
fetch('https://api.anysite.io/api/nytimes/articles/search', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.anysite.io/api/nytimes/articles/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'count' => 550,
'timeout' => 300,
'keyword' => '',
'types' => [
'article',
'athleticarticle',
'audio',
'carddeck',
'interactive',
'legacycollection',
'paidpost',
'recipe',
'slideshow',
'video',
'wirecutterarticle'
],
'sort' => 'best',
'language' => 'en',
'start_date' => '<string>',
'end_date' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"access-token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.anysite.io/api/nytimes/articles/search"
payload := strings.NewReader("{\n \"count\": 550,\n \"timeout\": 300,\n \"keyword\": \"\",\n \"types\": [\n \"article\",\n \"athleticarticle\",\n \"audio\",\n \"carddeck\",\n \"interactive\",\n \"legacycollection\",\n \"paidpost\",\n \"recipe\",\n \"slideshow\",\n \"video\",\n \"wirecutterarticle\"\n ],\n \"sort\": \"best\",\n \"language\": \"en\",\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.anysite.io/api/nytimes/articles/search")
.header("access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"count\": 550,\n \"timeout\": 300,\n \"keyword\": \"\",\n \"types\": [\n \"article\",\n \"athleticarticle\",\n \"audio\",\n \"carddeck\",\n \"interactive\",\n \"legacycollection\",\n \"paidpost\",\n \"recipe\",\n \"slideshow\",\n \"video\",\n \"wirecutterarticle\"\n ],\n \"sort\": \"best\",\n \"language\": \"en\",\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.anysite.io/api/nytimes/articles/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"count\": 550,\n \"timeout\": 300,\n \"keyword\": \"\",\n \"types\": [\n \"article\",\n \"athleticarticle\",\n \"audio\",\n \"carddeck\",\n \"interactive\",\n \"legacycollection\",\n \"paidpost\",\n \"recipe\",\n \"slideshow\",\n \"video\",\n \"wirecutterarticle\"\n ],\n \"sort\": \"best\",\n \"language\": \"en\",\n \"start_date\": \"<string>\",\n \"end_date\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body[
{
"uri": "<string>",
"asset_type": "<string>",
"document_title": "<string>",
"@type": "NytimesAsset",
"document_type": "<string>",
"web_url": "<string>",
"alias": "<string>",
"seo_title": "<string>",
"sub_headline": "<string>",
"kicker": "<string>",
"summary": "<string>",
"promotional_headline": "<string>",
"promotional_summary": "<string>",
"published_at": 123,
"updated_at": 123,
"word_count": 123,
"tone": "<string>",
"desk": "<string>",
"language": "<string>",
"section": {
"name": "<string>",
"@type": "NytimesSectionRef",
"uri": "<string>",
"display_name": "<string>",
"web_url": "<string>"
},
"subsection": {
"name": "<string>",
"@type": "NytimesSectionRef",
"uri": "<string>",
"display_name": "<string>",
"web_url": "<string>"
},
"authors": [],
"byline": "<string>",
"image": {
"image": "<string>",
"@type": "NytimesImage",
"uri": "<string>",
"width": 123,
"height": 123,
"caption": "<string>",
"credit": "<string>",
"alt_text": "<string>"
},
"tags": [],
"related": [],
"duration_seconds": 123
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
API token from the dashboard
Headers
Body
application/json
Required range:
1 <= x <= 1100Required range:
20 <= x <= 1500Available options:
article, athleticarticle, audio, carddeck, interactive, legacycollection, paidpost, recipe, slideshow, video, wirecutterarticle Available options:
best, newest, oldest Available options:
en, es, zh Available options:
archives, arts, automobiles, blogs, books, briefing, business, climate, crosswords, dining, education, fashion, garden, health, insider, learning, magazine, movies, nyregion, nytnow, obituaries, opinion, pageoneplus, podcasts, reader-center, realestate, science, smarter-living, sports, style, t-magazine, technology, theater, travel, upshot, us, weather, weekinreview, world, your-money Response
Successful Response
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I