ONYPHE ASD API
Attack Surface Discovery pivot queries (distinct field values).
Attack Surface Discovery pivot queries (distinct field values).
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/onyphe:onyphe-asd-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: ONYPHE API - Search, Export, Discovery and Pivot Query ASD…
version: '2026-10-21'
description: 'Developer reference for four ONYPHE endpoints: **Search**, **Export**,
**Discovery** (bulk) and **ASD Pivot Query**. Queries are written in OQL
(ONYPHE Query Language), always `FILTER:VALUE`. ## Two use cases, two data models
The `category` you query decides which **field names** you must use. A field from the wrong model **returns 0 results (or HTTP 400) and never
an explicit "unknown field" error**, which is indistinguishable from a
genuine absence. Pick the model first. ### A. IP enrichment and CTI: `ctiscan` and `ctiurl` (ctiscan data model)
- `ctiscan` is service-level: one document per scanned service, merging
every scanning step (IP, TCP, application, TLS/certificate, component,
DNS, HTTP, favicon, hashes...) so a single document carries every pivot. - `ctiurl` is URL-level and uses the same model; `http.url` is what
distinguishes it. - Fields are organised in *layers* (`ip.*`, `tcp.*`, `app.*`, `http.*`,
`cert.*`, `component.*`, `dns.*`, `html.*`, ...). - The raw response is `app.data.text` (up to ~1 MB). - Use it to enrich an IP (`ip.dest:1.2.3.4`), hunt infrastructure, and pivot
on certificates, hashes and fingerprints. - The Summary API never returns ctiscan/ctiurl; query them here. ### B. Attack surface management (ASM): `riskscan` and `vulnscan` (datascan data model)
- `datascan`, `vulnscan` and `riskscan` share one flat, datascan-style model
(`ip`, `port`, `protocol`, `hostname`, `domain`, `tag`, `cve`, `cpe`,
`seen_date`, `data`...). - `riskscan`: services matching a CTI-informed risk baseline, carrying
`risk::*` tags (exposed database, critical CVE, sensitive protocol,
compromised device...) and the positive CVE detections. About **7 months**
of history. Positive-only: it has no "not vulnerable" verdicts. Its raw
`data` is truncated after a period of time. - `vulnscan`: CVE detection by *check-based* (`vulnerable`, `notvulnerable`,
`maybevulnerable`, `unknownvulnerable`) and *version-based*
(`vulnerableversion`, `notvulnerableversion`, `maybevulnerableversion`,
`partialversion`, `unknownversion`, `version`) detection. Holds negative
verdicts, the full stored response and deeper history. Always add
`-exists:cve` when you want only records that carry a CVE. - Typical entry point is the **Discovery** endpoint, fed with an asset
inventory (one OQL line per domain/IP). ### Field dialect cheat-sheet
| Meaning | datascan / vulnscan / riskscan | ctiscan / ctiurl |
|---|---|---|
| IP | `ip` | `ip.dest` |
| Port | `port` | `tcp.dest` (this service), `services.port` (any open port on the host) |
| Protocol | `protocol` | `app.protocol` |
| Raw response | `data` (capped at 16384 bytes) | `app.data.text` (up to ~1 MB) |
| CPE | `cpe` | `component.cpe` |
| Product / vendor / version | `product`, `productvendor`, `productversion` | `component.product`, `component.vendor`, `component.version` |
| HTTP status | `status` | `http.code` |
| URL | `url` | `http.url` |
| Page title | `app.http.title` | `html.title.text` (full-text), `html.title.raw` (exact/regexp) |
| Device class | `device.class` | `app.device` |
| Reverse / forward DNS | `reverse` / `forward` | `dns.reverse.hostname` / `dns.forward.hostname` |
| ASN / organisation / country | `asn`, `organization`, `country` | `ip.asn`, `ip.organization`, `ip.country` |
| Cert subject CN / issuer org | `subject.commonname`, `issuer.organization` | `cert.subject.cn`, `cert.issuer.o` |
| Cert SHA-256 | `fingerprint.sha256` | `cert.fingerprint.sha256` |
Unchanged in both models: `tag`, `source`, `@category`, `@timestamp`,
`seen_date`. ## OQL notes
Plain filters are `FILTER:VALUE`. OR is `?`, NOT is `!`; there is no
`OR`/`NOT` keyword: `( ?domain:a.com ?domain:b.com )`, `!domain:google.com`. **Functions** are server-side, prefixed with `-`, written on the query
side (before any `|` post-processing). Every function has a short alias. They are licence-gated: one your subscription does not grant is refused
(`400 unknown function`), not ignored.'
contact:
name: ONYPHE
url: https://www.onyphe.io
license:
name: BSD-3-Clause
url: https://opensource.org/license/bsd-3-clause
servers:
- url: https://www.onyphe.io/api/v2
description: v2 API (Search, Export, Discovery). ASD overrides this per operation.
security:
- bearerAuth: []
tags:
- name: ASD
description: Attack Surface Discovery pivot queries (distinct field values).
paths:
/asd/pivot/query:
post:
tags:
- ASD
operationId: asdPivotQuery
summary: Distinct values of a field for an OQL query
description: 'Returns the **distinct values** of `field` across the documents matching
`query`, computed server-side with no paging. Use it to pivot: which
certificate organisations, issuers, hashes, ASNs... exist for this
population.
- Values come back **lowercased**. Feeding one back into OQL is fine
(matching is case-insensitive), but it is not the literal string observed.
- **No counts** are returned: it answers "which values", not "how many
of each". Pair with a Search `total` per value when the distribution matters.
- Name `field` in the model of the category in `query`: `cert.issuer.cn` for
`category:ctiscan`, `subject.organization` for `category:datascan`.
- `astask=true` creates a background task instead of answering inline;
error 1011 (*too many results, you should create a task*) tells you
to do so, and 1010 means the task is still running. Task polling is
documented separately and is out of scope here.
**Availability**: Griffin View only. Any other licence (e.g. ctiscan-only)
gets HTTP 400 `{"error":1001,"text":"API access denied"}`.
**ASD has its own endpoint, not its own key.** The ASD APIs are served
from `https://www.onyphe.io/api/v1`, separate from the v2 API, and take
the same API key in the `X-Api-Key` header.
Boolean options (`aslines`, `astask`) are the **strings** `"true"` /
`"false"`. A JSON boolean is silently ignored (`"aslines": true` returns
the JSON envelope, not NDJSON).
- With `aslines=true`, an empty population returns an empty body.
Omit `aslines` when the population may be empty to get `count: 0`
in the envelope.
- Unlike Search, a `field` from the wrong data model is an error:
HTTP 400, `error` 1006 ("No mapping found for []").'
servers:
- url: https://www.onyphe.io/api/v1
security:
- apiKeyAuth: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/PivotQueryRequest'
examples:
ctiscan-cti:
summary: A. CTI pivot on ctiscan
value:
query: category:ctiscan app.device:c2 -dayago:1
field: cert.issuer.cn
aslines: 'true'
datascan-asm:
summary: B. certificate organisations for a domain (datascan model)
value:
query: category:datascan domain:example.com tag:cert::valid
field: subject.organization
excludep:
- ^let's encrypt
responses:
'200':
description: 'Distinct values. With `aslines=true` the body is NDJSON, one object per
distinct value, nested by the field path. Without it the body is the JSON envelope below, carrying the
same nested objects in `results`.
'
content:
application/json:
schema:
$ref: '#/components/schemas/PivotQueryResponse'
example:
count: 2
error: 0
results:
- cert:
issuer:
cn: example-c2-ca
- cert:
issuer:
cn: example-router
text: success
trusted: 'true'
application/x-ndjson:
schema:
type: string
description: One JSON object per distinct value, when `aslines=true`.
example: '{"cert":{"issuer":{"cn":"example-c2-ca"}}}
{"cert":{"issuer":{"cn":"example-router"}}}
'
'400':
description: '`{error, text}`. Missing key (1002), unknown key (1003 "user not found"), missing or invalid parameter (1002), wrong-model `field` (1006), too many results (1011). A licence without Griffin View (e.g. ctiscan-only) gets 1001 "API access denied" on every ASD endpoint.'
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'429':
$ref: '#/components/responses/RateLimited'
x-codeSamples:
- lang: Shell
label: curl
source: "curl -H 'Content-Type: application/json' -H \"X-Api-Key: $ONYPHE_API_KEY\" \\\n -XPOST 'https://www.onyphe.io/api/v1/asd/pivot/query' \\\n -d '{\"query\":\"category:ctiscan app.device:c2 -dayago:1\",\"field\":\"cert.issuer.cn\",\"aslines\":\"true\"}'\n"
components:
schemas:
PivotQueryResponse:
type: object
properties:
count:
type: integer
description: Number of distinct values.
error:
type: integer
description: 0 on success.
results:
type: array
description: One object per distinct value, nested by the field path (e.g. `{"cert":{"issuer":{"cn":"r12"}}}`). Values are lowercased.
items:
type: object
additionalProperties: true
text:
type: string
example: success
trusted:
type: string
enum:
- 'true'
- 'false'
required:
- error
Error:
type: object
description: 'Error envelope, sent with HTTP 400. `error` is 0 on success. v2 codes are
listed in the API description (Errors). Codes published for the ASD APIs:
1 internal failure; 2 request timed out; 3 connection refused; 4 unable
to fork a new process; 1000 API not found; 1001 API access denied; 1002
parameter error; 1003 user not found; 1004 user get failed; 1005 no more
credits; 1006 search failed; 1007 task not found; 1008 creating task failed;
1009 getting task result failed; 1010 task in progress; 1011 too many
results, you should create a task; 1012 unable to kill task; 1013 resolver
failed. Other endpoints may return codes outside this list. Rate limiting
is signalled by HTTP 429.
'
properties:
error:
type: integer
description: 0 on success; see the codes above.
text:
type: string
status:
type: string
example: nok
description: v2 only.
count:
type: integer
description: v2 only.
myip:
type: string
description: v2 only.
took:
description: v2 only.
total:
type: integer
description: v2 only.
required:
- error
PivotQueryRequest:
type: object
required:
- query
- field
properties:
query:
type: string
description: OQL query to execute.
field:
type: string
description: Field to pivot on, in the data model of the queried category.
aslines:
type: string
enum:
- 'true'
- 'false'
default: 'false'
description: '"true" returns one JSON object per line (NDJSON); "false" returns the JSON envelope. Must be a string: a JSON boolean is ignored.'
astask:
type: string
enum:
- 'true'
- 'false'
default: 'false'
description: '"true" creates a background task for later processing.'
includep:
description: One or more case-insensitive, unanchored regular expressions (`^`/`$` anchor explicitly); only values matching one are kept. A string or an array.
oneOf:
- type: string
- type: array
items:
type: string
excludep:
description: One or more case-insensitive, unanchored regular expressions; values matching one are removed. A string or an array.
oneOf:
- type: string
- type: array
items:
type: string
responses:
RateLimited:
description: Rate limit reached (about 1 request per second). Wait and retry.
securitySchemes:
bearerAuth:
type: http
scheme: bearer
description: 'v2 API key, sent as `Authorization: Bearer <key>` (scheme name case-insensitive).'
apiKeyAuth:
type: apiKey
in: header
name: X-Api-Key
description: The same API key as `bearerAuth`, sent in the `X-Api-Key` header by the ASD v1 API (Griffin View only).
externalDocs:
description: ONYPHE documentation
url: https://search.onyphe.io/docs