ScanMalware Smql API
The smql API from ScanMalware — 7 operation(s) for smql.
The smql API from ScanMalware — 7 operation(s) for smql.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.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.curl "https://apis.io/api/v1/apis/scanmalware-com:scanmalware-com-smql-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a 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. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: ScanMalware Smql API
description: URL Security Scanner API
version: 1.0.0
tags:
- name: smql
paths:
/api/v1/search/smql:
get:
tags:
- smql
summary: Smql Search
description: 'Search scans using the ScanMalware Query Language (SMQL).
Syntax examples:
- Simple text: `paypal login`
- Filters: `domain:paypal.com`, `country:RU`, `technology:WordPress`
- Boolean: `technology:WordPress AND country:RU`
- Negation: `-domain:google.com` or `NOT domain:google.com`
- Grouping: `(technology:WordPress OR technology:Joomla) AND country:CN`
- Several values of one field: `domain:(paypal.com OR paypal.me)`, `ip:(1.1.1.1 8.8.8.8)`
(values without an operator are ORed), `technology:(WordPress AND WooCommerce)`
- Defanged indicators are accepted: `domain:paypal[.]com`, `hxxps://evil[.]com/login`;
`notes` in the response shows how each was read
- Ranges: `js_risk_score:60..100`, `submitted:last7d`
- Existence: `has:malware`, `has:pastejacking`
- CT-backed: `ct_domain:example.com`, `ct_hash:`,
`ct_domain:example.com AND ct_issued:>2024-01-01` — resolved against Certificate
Transparency data into a domain set (capped at 1000; cannot be negated).
`ct_issued` must be combined with `ct_domain`, `ct_san` or `ct_hash`. Wildcard
CT domains such as `ct_domain:*.paypal.com` are slower and can return 503 while
the CT service is busy.'
operationId: smql_search_api_v1_search_smql_get
parameters:
- name: q
in: query
required: true
schema:
type: string
minLength: 1
maxLength: 2000
description: SMQL query string
title: Q
description: SMQL query string
- name: page
in: query
required: false
schema:
type: integer
maximum: 1000
minimum: 1
description: Page number
default: 1
title: Page
description: Page number
- name: limit
in: query
required: false
schema:
type: integer
maximum: 100
minimum: 1
description: Results per page
default: 20
title: Limit
description: Results per page
- name: sort
in: query
required: false
schema:
type: string
description: 'Sort order: newest, oldest, url, load_time, ip_count'
default: newest
title: Sort
description: 'Sort order: newest, oldest, url, load_time, ip_count'
- name: count_only
in: query
required: false
schema:
type: boolean
description: Return only the number of matching scans, without results. Faster when only the count is needed.
default: false
title: Count Only
description: Return only the number of matching scans, without results. Faster when only the count is needed.
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/search/smql/counts:
post:
tags:
- smql
summary: Smql Counts
description: 'The number of public scans matching each of several SMQL queries, in one request.
The same count `GET /search/smql?count_only=true` gives for one query: `total_items` (stops at
10,000, then `exact_count` is false) or, when the count ran out of time, `total_items: null`
with `count_unavailable: true`. A query that does not parse gets `error` and `message` instead,
without failing the others. Counts are cached for up to 30 minutes.
With `sites: true`, a query with enough matches (`sites_min`, default 10) also gets `sites`,
`elevated_sites`, `shared_widely` and `hosts` (see the fields), or `sites_unavailable` when that summary
ran out of time, and `hunt: true` when a hunt searches for that value. With `exclude_site` as well, the summary
adds `others`: the sites other than that one, by AI verdict, with up to five names and a key for the set.
With `patient: true` (at most 4 queries), each count gets a longer time budget and a count that ran out of
time before is run again: send it once for the queries that came back `count_unavailable`.'
operationId: smql_counts_api_v1_search_smql_counts_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SMQLCountsRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/search/smql/hunt-check:
post:
tags:
- smql
summary: Smql Hunt Check
description: 'Which of these values a hunt searches for: the queries, among those sent, that are a single
`field:value` match a hunt uses (its query''s plain matches, its hunting rule, its script hashes),
compared the way the filters compare (host names without case, hex digests without case). The same
answer `hunt: true` gives in `POST /search/smql/counts` with `sites`, without counting anything.'
operationId: smql_hunt_check_api_v1_search_smql_hunt_check_post
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SMQLHuntCheckRequest'
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/search/smql/facets:
get:
tags:
- smql
summary: Smql Facets
description: 'What the scans matching an SMQL query have in common: the most frequent hosting networks,
countries, domains, registrars, certificate issuers, technologies, favicons, JARM
fingerprints, tracking IDs and AI verdicts.
Counts are taken over the newest `sample` matching scans, not every match; `sample` in the
response gives the number aggregated and their date span. Each value carries `query`, the
SMQL filter that finds those scans, ready to AND onto the original query. A filter can match
more scans than its count (`registrar:` also matches third-party domains a page loaded).'
operationId: smql_facets_api_v1_search_smql_facets_get
parameters:
- name: q
in: query
required: true
schema:
type: string
minLength: 1
maxLength: 2000
description: SMQL query string
title: Q
description: SMQL query string
- name: fields
in: query
required: false
schema:
anyOf:
- type: string
maxLength: 400
- type: 'null'
description: Comma-separated facet names (see `available` in any response); a default set when omitted
title: Fields
description: Comma-separated facet names (see `available` in any response); a default set when omitted
- name: size
in: query
required: false
schema:
type: integer
maximum: 25
minimum: 1
description: Values per facet
default: 10
title: Size
description: Values per facet
- name: sample
in: query
required: false
schema:
type: integer
maximum: 5000
minimum: 100
description: How many of the newest matching scans to aggregate
default: 1000
title: Sample
description: How many of the newest matching scans to aggregate
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/search/smql/domains:
get:
tags:
- smql
summary: Smql Domain Search
description: 'Search DOMAINS rather than scans: lists every matching domain, including domains
ScanMalware has never scanned, each annotated with its newest public scan if one exists.
Filters (see `filters` in any response):
- `ct_ip:158.94.209.214` or `ct_ip:158.94.209.0/24`: domains seen on the address when their
certificates were issued. Not re-checked, so domains that moved there later are missing.
- `nameserver:ns1.example.com`: registered domains delegated to a nameserver (`coverage` lists
the TLDs covered). Exact name only. Add `AND tld:se` for one TLD.
- `ct_domain:*ledger-live*`, `ct_san:...`: hostnames in every stored certificate log;
`AND ct_issued:last7d` searches only the logs that can hold certificates issued since then,
which makes a wildcard much faster.
A wildcard search over every stored log takes a minute or more. While it runs the endpoint
answers **202** with `status: "running"`, `progress.percent` and `estimated_remaining_ms`; while
other certificate searches leave no room to start it, **202** with `status: "queued"`. Repeat
the same request every couple of seconds until it answers 200. The finished result is cached
for an hour.'
operationId: smql_domain_search_api_v1_search_smql_domains_get
parameters:
- name: q
in: query
required: true
schema:
type: string
minLength: 1
maxLength: 2000
description: SMQL query using domain filters
title: Q
description: SMQL query using domain filters
- name: limit
in: query
required: false
schema:
type: integer
maximum: 500
minimum: 1
description: Domains per page
default: 100
title: Limit
description: Domains per page
- name: cursor
in: query
required: false
schema:
anyOf:
- type: string
maxLength: 253
- type: 'null'
description: '`next_cursor` from the previous page'
title: Cursor
description: '`next_cursor` from the previous page'
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
'202':
description: 'A certificate-log search (`ct_domain:` / `ct_san:`) is still running, or waits for another one to finish. The body carries `status: "running"` or `"queued"`; repeat the same request after `Retry-After` seconds until it answers 200.'
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
/api/v1/search/smql/stats:
get:
tags:
- smql
summary: Smql Stats
description: Return estimated total public scan count (from pg_class, essentially free).
operationId: smql_stats_api_v1_search_smql_stats_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
/api/v1/search/smql/filters:
get:
tags:
- smql
summary: Smql Filters
description: Return all available SMQL filters grouped by category.
operationId: smql_filters_api_v1_search_smql_filters_get
responses:
'200':
description: Successful Response
content:
application/json:
schema: {}
components:
schemas:
SMQLCountsRequest:
properties:
queries:
items:
type: string
type: array
maxItems: 25
minItems: 1
title: Queries
description: Up to 25 SMQL queries
sites:
type: boolean
title: Sites
description: 'Also summarise the sites behind each query with 10 or more matches: `sites` (distinct registrable domains among up to 200 matching scans), `elevated_sites` (those rated high risk or worse) and `shared_widely` (many sites, and no more of them rated high risk than across all scanned sites: a value common to unrelated sites, such as a widely used script). A value that a hunt searches for is never `shared_widely`, and carries `hunt: true`. The summary also carries `hosts`: distinct submitted hosts (without www.) among the same sample.'
default: false
sites_min:
type: integer
maximum: 10.0
minimum: 2.0
title: Sites Min
description: With `sites`, summarise queries with at least this many matches (2-10, default 10). `shared_widely` still needs 10 or more sites.
default: 10
exclude_site:
anyOf:
- type: string
maxLength: 253
pattern: ^[A-Za-z0-9._\-:\[\]]+$
- type: 'null'
title: Exclude Site
description: 'With `sites`, also describe the sites other than this one (a host; with or without www., any case; a scan of it counts as its own when its submitted or final host is this host): `others` with `sites`, `verdicts` (sites by the worst AI verdict among their sampled scans: CONFIRMED_SCAM, HIGH_RISK, MODERATE_RISK, LOW_RISK, LEGITIMATE, NONE), `names` (up to 5, worst rated first), `complete` (the sample of up to 200 scans held every match) and, when complete, `set` (a short key of the exact set of other sites: two values with the same `set` lead to the same sites).'
patient:
type: boolean
title: Patient
description: Count again with a longer time budget (15 s instead of 5 s), for queries whose count came back `count_unavailable`; at most 4 queries. A count that ran out of time before is counted again, not answered from the cache.
default: false
type: object
required:
- queries
title: SMQLCountsRequest
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
input:
title: Input
ctx:
type: object
title: Context
type: object
required:
- loc
- msg
- type
title: ValidationError
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError
SMQLHuntCheckRequest:
properties:
queries:
items:
type: string
type: array
maxItems: 1000
minItems: 1
title: Queries
description: Up to 1000 single-value SMQL queries
type: object
required:
- queries
title: SMQLHuntCheckRequest
securitySchemes:
OptionalHTTPBearer:
type: http
scheme: bearer
HTTPBearer:
type: http
scheme: bearer