FRED · API Governance Rules
FRED API Rules
Spectral linting rules defining API design standards and conventions for FRED.
44 Rules
error 20
warn 18
info 6
Authorship not recorded
No authorship marker is recorded for this file. It is not presented as the provider's; it was most likely written by an API Evangelist pass before outputs were stamped.
Rule Categories
description
examples
external
global
http
info
no
openapi
operation
parameter
paths
response
schema
security
servers
Rules
error
info-title-fred-prefix
API title must start with "FRED".
$.info.title
error
info-description-required
Info description is required and should be substantive.
$.info
warn
info-description-minlength
Info description should be at least 120 characters.
$.info.description
error
info-version-required
Info version is required.
$.info
warn
info-contact-required
Info contact block is required (St. Louis Fed Research Division).
$.info
warn
info-license-required
Info license block is required.
$.info
error
openapi-version-3
Must use OpenAPI 3.x.
$.openapi
error
servers-required
At least one server must be defined.
$.servers
error
servers-https-only
FRED endpoints are HTTPS only.
$.servers[*].url
warn
servers-stlouisfed-host
Server URL must be on api.stlouisfed.org.
$.servers[*].url
warn
paths-snake-case
FRED paths use snake_case segments (e.g. /release/related_tags).
$.paths.*~
error
paths-no-trailing-slash
No trailing slashes on path keys.
$.paths.*~
error
paths-no-query-string
Paths must not embed query strings.
$.paths.*~
error
operation-operationid-required
Every operation must have an operationId.
$.paths.*.*
warn
operation-operationid-camelcase
operationId must be lowerCamelCase, verb-first.
$.paths.*.*.operationId
error
operation-summary-required
Every operation must have a summary.
$.paths.*.*
warn
operation-summary-fred-prefix
Summaries should start with "FRED" so they read well in catalogs.
$.paths.*.*.summary
warn
operation-description-required
Every operation must have a description.
$.paths.*.*
error
operation-tags-required
Every operation must have at least one tag.
$.paths.*.*
info
operation-microcks-extension
Operations should carry x-microcks-operation for mock-server compatibility.
$.paths.*.*
warn
global-tags-defined
Top-level tags array must be defined and non-empty.
$
warn
global-tag-description
Each tag should have a description.
$.tags[*]
warn
global-tag-title-case
Tag names use Title Case (Categories, Releases, Series, Sources, Tags, Observations, Series Group, Regional Data).
$.tags[*].name
warn
parameter-description-required
Every parameter needs a description.
$.paths.*.*.parameters[*]
error
parameter-snake-case
FRED parameters use snake_case (api_key, series_id, file_type, realtime_start).
$.paths.*.*.parameters[?(@.name)]
error
parameter-api-key-required-on-every-operation
Every operation must include api_key (directly or via $ref).
$.paths.*.*
warn
parameter-pagination-limit-offset
FRED paginates with limit + offset. Don't introduce page/size, cursor, or next_token.
$.paths.*.*.parameters[?(@.name)].name
error
parameter-realtime-period-snake
Real-time period parameters must be realtime_start / realtime_end (not realTimeStart, real_time_start).
$.paths.*.*.parameters[?(@.name=='realTimeStart' || @.name=='real_time_start' || @.name=='realTimeEnd' || @.name=='real_time_end')]
error
no-request-body-on-get
GET operations must not declare a requestBody (FRED is GET-only with query parameters).
$.paths.*.get
error
response-200-required
Every operation must declare a 200 success response.
$.paths.*.*.responses
warn
response-content-json
2xx responses must offer application/json.
$.paths.*.*.responses.200.content
warn
response-schema-required
2xx JSON responses must declare a schema.
$.paths.*.*.responses.200.content.application/json
info
response-400-recommended
Operations should declare a 400 Bad Request response.
$.paths.*.*.responses
info
response-403-recommended
Operations should declare a 403 Forbidden response for missing/invalid api_key.
$.paths.*.*.responses
warn
schema-property-snake-case
Schema properties use snake_case (series_id, realtime_start, last_updated).
$.components.schemas[*].properties.*~
warn
schema-top-level-description
Top-level schemas should carry a description.
$.components.schemas[*]
error
schema-type-defined
Top-level schemas must declare a type.
$.components.schemas[*]
info
schema-seriess-wrapper-allowed
FRED intentionally uses the "seriess" property name on series-list responses. Documenting this for downstream tools so they don't auto-correct.
$.components.schemas.SeriesList.properties
error
security-global-required
Global security must be declared.
$
error
security-apikey-scheme
Security scheme must be apiKey in query (FRED uses ?api_key=...).
$.components.securitySchemes.ApiKeyAuth
error
http-method-get-only
FRED is read-only. Only GET methods are allowed.
$.paths.*
warn
description-no-empty
Descriptions must not be empty strings.
$..description
info
examples-on-responses
2xx JSON responses should carry at least one named example.
$.paths.*.*.responses.200.content.application/json
info
external-docs-encouraged
An externalDocs block helps consumers find the canonical reference page.
$
Spectral Ruleset
Work with this as data
Every ruleset here is available over the APIs.io API and to AI agents over MCP.