The New York Times Company · API Governance Rules
The New York Times Company API Rules
Spectral linting rules defining API design standards and conventions for The New York Times Company.
The New York Times Company API Rules is a Spectral governance ruleset published by The New York Times Company on the APIs.io network, containing 10 lint rules.
The ruleset includes 6 error-severity rules and 4 warning-severity rules.
Tagged areas include News, Media, Publishing, Newspapers, and Articles.
Rulesets can be applied to your own OpenAPI specs via Spectral to enforce the same governance standards.
10 Rules
error 6
warn 4
Rule Categories
nyt
Rules
error
nyt-host-must-be-api-nytimes-com
All NYT public APIs are served from api.nytimes.com.
$
error
nyt-must-use-apikey-security
NYT APIs require a query-string api-key.
$.security
error
nyt-apikey-must-be-query-parameter
NYT publishes the api-key as a query-string parameter named api-key.
$.securityDefinitions.apikey
error
nyt-schemes-must-include-https
NYT APIs must be reachable over HTTPS.
$.schemes
warn
nyt-paths-must-end-in-dot-json
NYT response paths are .json files (e.g. /home.json, /{section}.json).
$.paths
warn
nyt-operations-must-return-401-on-missing-key
All NYT operations should document the 401 unauthorized response.
$.paths.*.*.responses
warn
nyt-operations-must-return-429-on-rate-limit
All NYT operations should document the 429 too-many-requests response.
$.paths.*.*.responses
warn
nyt-tags-must-be-title-case
NYT tags must use Title Case (e.g. 'Top Stories', not 'topstories').
$..tags[*]
error
nyt-info-must-include-version
All NYT specs declare a version under info.
$.info
error
nyt-info-must-include-description
Every NYT spec embeds a descriptive overview in info.description.
$.info