Shodan · API Governance Rules

Shodan API Rules

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

11 Rules error 6 warn 5
View Rules File View on GitHub

Rule Categories

shodan

Rules

error
shodan-info-contact
Shodan APIs must declare a contact with email and URL.
$.info.contact
error
shodan-info-license
Shodan APIs must declare a license referencing the Shodan ToS.
$.info.license
error
shodan-server-https
All Shodan servers must be HTTPS endpoints under shodan.io.
$.servers[*].url
warn
shodan-security-apikey
All authenticated Shodan APIs must use the `apiKey` query-parameter scheme named `key`.
$.components.securitySchemes[?(@.type=='apiKey')]
error
shodan-operation-tags
Every operation must declare at least one tag.
$.paths[*][get,post,put,delete,patch]
error
shodan-operation-operationId
Every operation must have a camelCase operationId.
$.paths[*][get,post,put,delete,patch]
warn
shodan-operation-summary-title-case
Operation summaries should use Title Case.
$.paths[*][get,post,put,delete,patch].summary
warn
shodan-operation-description
Operations should have a description.
$.paths[*][get,post,put,delete,patch]
error
shodan-response-200
GET operations must define a 200 response.
$.paths[*].get
warn
shodan-parameter-description
Path and query parameters should be described.
$.paths[*][get,post,put,delete,patch].parameters[*]
warn
shodan-tag-defined
Tags used on operations must be defined at the document level.
$

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
formats:
  - oas3
documentationUrl: https://developer.shodan.io/
rules:
  shodan-info-contact:
    description: Shodan APIs must declare a contact with email and URL.
    severity: error
    given: "$.info.contact"
    then:
      - field: email
        function: truthy
      - field: url
        function: truthy

  shodan-info-license:
    description: Shodan APIs must declare a license referencing the Shodan ToS.
    severity: error
    given: "$.info.license"
    then:
      - field: name
        function: truthy
      - field: url
        function: truthy

  shodan-server-https:
    description: All Shodan servers must be HTTPS endpoints under shodan.io.
    severity: error
    given: "$.servers[*].url"
    then:
      function: pattern
      functionOptions:
        match: "^https://[a-z0-9.-]*shodan\\.io"

  shodan-security-apikey:
    description: All authenticated Shodan APIs must use the `apiKey` query-parameter scheme named `key`.
    severity: warn
    given: "$.components.securitySchemes[?(@.type=='apiKey')]"
    then:
      - field: in
        function: pattern
        functionOptions:
          match: "^query$"
      - field: name
        function: pattern
        functionOptions:
          match: "^key$"

  shodan-operation-tags:
    description: Every operation must declare at least one tag.
    severity: error
    given: "$.paths[*][get,post,put,delete,patch]"
    then:
      field: tags
      function: truthy

  shodan-operation-operationId:
    description: Every operation must have a camelCase operationId.
    severity: error
    given: "$.paths[*][get,post,put,delete,patch]"
    then:
      field: operationId
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]+$"

  shodan-operation-summary-title-case:
    description: Operation summaries should use Title Case.
    severity: warn
    given: "$.paths[*][get,post,put,delete,patch].summary"
    then:
      function: pattern
      functionOptions:
        match: "^(?:[A-Z][a-zA-Z0-9]*(?: [A-Z][a-zA-Z0-9]*| (?:and|or|of|to|for|in|on|by|the|a|an|with|from|at|as)| [A-Z]+)*)$"

  shodan-operation-description:
    description: Operations should have a description.
    severity: warn
    given: "$.paths[*][get,post,put,delete,patch]"
    then:
      field: description
      function: truthy

  shodan-response-200:
    description: GET operations must define a 200 response.
    severity: error
    given: "$.paths[*].get"
    then:
      field: responses.200
      function: truthy

  shodan-parameter-description:
    description: Path and query parameters should be described.
    severity: warn
    given: "$.paths[*][get,post,put,delete,patch].parameters[*]"
    then:
      field: description
      function: truthy

  shodan-tag-defined:
    description: Tags used on operations must be defined at the document level.
    severity: warn
    given: "$"
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          required: [tags]
          properties:
            tags:
              type: array
              minItems: 1

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/shodan-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.