DuckDuckGo · API Governance Rules

DuckDuckGo API Rules

Spectral linting rules defining API design standards and conventions for DuckDuckGo.

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

Rule Categories

ddg

Rules

error
ddg-info-contact
DuckDuckGo specs must declare a contact pointing at https://duckduckgo.com/api.
$.info.contact
error
ddg-server-https-api-host
The Instant Answer server must be api.duckduckgo.com over HTTPS.
$.servers[*].url
error
ddg-operation-id-camel
Operation IDs must be lowerCamelCase.
$.paths.*.*.operationId
warn
ddg-operation-summary-title-case
Operation summaries should use Title Case.
$.paths.*.*.summary
warn
ddg-query-format-enum
The `format` query parameter must be enumerated to json, xml.
$.paths.*.*.parameters[?(@.name == 'format')]
error
ddg-required-q-parameter
Every operation must accept a required `q` query parameter.
$.paths.*.get
warn
ddg-response-includes-redirect
Instant Answer responses must document a Redirect field for !bang support.
$.components.schemas.InstantAnswer.properties

Spectral Ruleset

Raw ↑
extends: [[spectral:oas, all]]
formats:
  - oas3
rules:
  ddg-info-contact:
    description: DuckDuckGo specs must declare a contact pointing at https://duckduckgo.com/api.
    given: $.info.contact
    severity: error
    then:
      field: url
      function: pattern
      functionOptions:
        match: '^https://duckduckgo\.com/api'
  ddg-server-https-api-host:
    description: The Instant Answer server must be api.duckduckgo.com over HTTPS.
    given: $.servers[*].url
    severity: error
    then:
      function: pattern
      functionOptions:
        match: '^https://api\.duckduckgo\.com'
  ddg-operation-id-camel:
    description: Operation IDs must be lowerCamelCase.
    given: $.paths.*.*.operationId
    severity: error
    then:
      function: pattern
      functionOptions:
        match: '^[a-z][a-zA-Z0-9]+$'
  ddg-operation-summary-title-case:
    description: Operation summaries should use Title Case.
    given: $.paths.*.*.summary
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: '^([A-Z][a-zA-Z0-9]*)(\s[A-Z][a-zA-Z0-9]*)*$'
  ddg-query-format-enum:
    description: The `format` query parameter must be enumerated to json, xml.
    given: $.paths.*.*.parameters[?(@.name == 'format')]
    severity: warn
    then:
      field: schema.enum
      function: defined
  ddg-required-q-parameter:
    description: Every operation must accept a required `q` query parameter.
    given: $.paths.*.get
    severity: error
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          properties:
            parameters:
              type: array
              contains:
                type: object
                properties:
                  name: { const: q }
                  in: { const: query }
                  required: { const: true }
                required: [name, in, required]
  ddg-response-includes-redirect:
    description: Instant Answer responses must document a Redirect field for !bang support.
    given: $.components.schemas.InstantAnswer.properties
    severity: warn
    then:
      field: Redirect
      function: defined

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/instant-answer-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.