US Census Bureau · API Governance Rules

US Census Bureau API Rules

Spectral linting rules defining API design standards and conventions for US Census Bureau.

7 Rules error 3 warn 4
View Rules File View on GitHub

Rule Categories

census

Rules

error
census-info-contact-required
Every Census Bureau API must publish a contact under `info.contact`.
$.info
error
census-info-license-required
All Census Bureau APIs are released under CC0 / Public Domain — `info.license` must be present.
$.info
warn
census-server-must-use-api-census-gov
Census Data and Microdata APIs must be served from `https://api.census.gov/data`.
$.servers[*].url
warn
census-operations-title-case-summary
Operation summaries must use Title Case (sentence-style summaries are not allowed).
$.paths.*.*.summary
error
census-operations-operationid-camelcase
operationId must be camelCase.
$.paths.*.*.operationId
warn
census-data-api-key-required
All Census Data API operations (excluding metadata endpoints) must declare `ApiKeyQuery` security.
$.paths['/{vintage}/acs/acs5','/{vintage}/acs/acs1','/{vintage}/dec/pl','/{vintage}/cbp','/{vintage}/pep/population','/{vintage}/pulse'].get
warn
census-paths-must-include-vintage
Census Data API paths must include a `{vintage}` path parameter so consumers can target the correct reference year.
$.paths

Spectral Ruleset

Raw ↑
extends: [[spectral:oas, all]]
rules:
  census-info-contact-required:
    description: Every Census Bureau API must publish a contact under `info.contact`.
    severity: error
    given: $.info
    then:
      field: contact
      function: truthy
  census-info-license-required:
    description: All Census Bureau APIs are released under CC0 / Public Domain — `info.license` must be present.
    severity: error
    given: $.info
    then:
      field: license
      function: truthy
  census-server-must-use-api-census-gov:
    description: Census Data and Microdata APIs must be served from `https://api.census.gov/data`.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: '^https://(api\.census\.gov/data|geocoding\.geo\.census\.gov|tigerweb\.geo\.census\.gov|www\.census\.gov).*'
  census-operations-title-case-summary:
    description: Operation summaries must use Title Case (sentence-style summaries are not allowed).
    severity: warn
    given: $.paths.*.*.summary
    then:
      function: pattern
      functionOptions:
        match: '^[A-Z0-9][A-Za-z0-9]*(\s(A|An|And|As|At|But|By|For|From|In|Into|Of|On|Or|The|To|With|[A-Z0-9][A-Za-z0-9]*))*$'
  census-operations-operationid-camelcase:
    description: operationId must be camelCase.
    severity: error
    given: $.paths.*.*.operationId
    then:
      function: pattern
      functionOptions:
        match: '^[a-z][a-zA-Z0-9]+$'
  census-data-api-key-required:
    description: All Census Data API operations (excluding metadata endpoints) must declare `ApiKeyQuery` security.
    severity: warn
    given: $.paths['/{vintage}/acs/acs5','/{vintage}/acs/acs1','/{vintage}/dec/pl','/{vintage}/cbp','/{vintage}/pep/population','/{vintage}/pulse'].get
    then:
      field: security
      function: truthy
  census-paths-must-include-vintage:
    description: Census Data API paths must include a `{vintage}` path parameter so consumers can target the correct reference year.
    severity: warn
    given: $.paths
    then:
      function: pattern
      functionOptions:
        match: '\{vintage\}'

Work with this as data

Every ruleset here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for spectral rules

4 MCP tools reach this
  • find_rulesBrowse and filter every ruleset in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This ruleset
curl "https://apis.io/api/v1/rules/census-data-api-rules"
All spectral rules
curl "https://apis.io/api/v1/rules?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.