Shodan icon

Shodan

Interact with Shodan API

Actions8

Search → Count

AI-generated

Summary

Counts the number of hosts matching a Shodan query without consuming API credits.

Inputs

  • query (required) — Search query string used to count matching hosts.
  • additionalFields — Optional collection that may include facets, limit, page, and minify to customize the count request.
  • requestOptions — Optional collection for advanced request settings such as batching, proxy, timeout, and SSL verification.

Output shape

a single integer representing the total number of matching results

Success returns the count as a top‑level numeric field; no pagination or additional fields; errors follow the standard Shodan error format.

Examples

Example 1: Basic count of hosts matching a query

query: 'apache country:US' (no additional or request options)

Example 2: Count with result limiting and facet summary

query: 'sslCert:80', additionalFields: {facets: 'org,city', limit: 25}

Example 3: Count using batching configuration

query: 'websocket', requestOptions: {batching: {batchSize: 50, batchInterval: 0}}

Links

Discussion