Tutorial
Start here: a learning-oriented guide to making your first DETEQTIVE DNS API queries.
Read moreDeteqtive
Everything you need to integrate and use the DETEQTIVE DNS API.
DETEQTIVE DNS - Global Uncached Lookup Log Your passive DNS flight recorder
Welcome to the DETEQTIVE DNS API documentation.
All API requests require a Bearer token. Set it once in your shell and all examples will work:
export DETEQTIVE_TOKEN="your-api-token-here"
This documentation is organized into four types to help you find what you need:
Start here if you’re new to the DETEQTIVE DNS API
Practical guides for specific tasks
Complete technical reference
Concepts and design decisions
Search for all A records for google.com:
curl -H "Authorization: Bearer $DETEQTIVE_TOKEN" https://api.deteqtive.com/api/v3/rrset/em/google.com/A
Response (NDJSON format):
{"rrname":"google.com","rrtype":"A","rdata":"142.250.185.46","first_seen":"2023-01-01T12:00:00Z","last_seen":"2023-12-31T23:59:59Z","sightings":1542}
{"eof":true,"count":1,"elapsed":0.102,"error":null}
New to the API? Start with the Tutorial
| What do you want to do? | Where to look |
|---|---|
| Learn the basics | Tutorial |
| Search for a specific domain | How-To: Domain Searches |
| Find all IPs for a domain | How-To: A Record Lookup |
| Find all domains on an IP | How-To: Reverse DNS |
| Query a subnet | How-To: CIDR Searches |
| Filter by date range | How-To: Time Filtering |
| Understand search types | Explanation: Search Strategies |
| Generate a Python client | How-To: Client Generation |
| Handle errors | Reference: Error Messages |
| Understand the response | Explanation: NDJSON Format |
Search DNS records by domain name:
GET /api/v3/rrset/{type}/{value}
GET /api/v3/rrset/{type}/{value}/{rrtype}
GET /api/v3/rrset/{type}/{value}/{rrtype}/{bailiwick}
Search Types:
em - Exact Match (google.com)rm - Right Match (*.google.com)lm - Left Match (google.*)fm - Fuzzy Match (similar domains)wm - Word Match (contains token)Search DNS records by IP, CIDR, or hostname:
GET /api/v3/rdata/{value}
GET /api/v3/rdata/{value}/{rrtype}
GET /api/v3/rdata/{value}/{rrtype}/{bailiwick}
Supported Values:
1.2.3.42001:db8::1192.0.2.0%2F242001:db8::%2F32ns1.example.comThe API provides an OpenAPI 3.0.3 specification that you can use to generate client libraries, import into API tools, and more.
Download the spec:
curl -H "Authorization: Bearer $DETEQTIVE_TOKEN" https://api.deteqtive.com/api/v3/openapi/pdns.yaml > deteqtive-openapi.yaml
Generate a Python client:
npx @openapitools/openapi-generator-cli generate \
-i deteqtive-openapi.yaml \
-g python \
-o ./deteqtive-python-client \
--package-name deteqtive_client
Generate a Go client:
npx @openapitools/openapi-generator-cli generate \
-i deteqtive-openapi.yaml \
-g go \
-o ./deteqtive-go-client \
--package-name deteqtive
See How-To: Generate API Clients for complete examples.
All API responses use NDJSON (Newline-Delimited JSON):
eof status line is missing, the response was truncatedExample response:
{"rrname":"example.com","rrtype":"A","rdata":"93.184.216.34","first_seen":"2023-01-01T00:00:00Z","last_seen":"2023-12-31T23:59:59Z","sightings":500}
{"rrname":"example.com","rrtype":"A","rdata":"93.184.216.35","first_seen":"2023-06-01T00:00:00Z","last_seen":"2023-12-31T23:59:59Z","sightings":200}
{"eof":true,"count":2,"elapsed":0.102,"error":null}
Learn more: Explanation: NDJSON Streaming
The API uses normalized, user-friendly error messages that protect backend implementation details:
{"eof":false,"count":0,"elapsed":0.002,"error":"query timeout - please refine your search or try again later"}
{"eof":false,"count":0,"elapsed":0.002,"error":"a temporary error occurred - please try again later"}
{"eof":false,"count":0,"elapsed":0.002,"error":"the request could not be completed - please check your search parameters"}
All errors return:
eof: false - Query did not complete successfullycount: N - Number of records returned before errorelapsed: N - Time elapsed before error, in secondserror: "message" - User-friendly error descriptionLearn more: Reference: Error Messages
last_seen in past 2 weeks)"query timeout - please refine your search or try again later"last_seen_after=0Q: How do I encode CIDR notation in URLs?
A: Replace / with %2F: 192.0.2.0/24 -> 192.0.2.0%2F24
Q: How do I include bailiwick information?
A: Add ?withbailiwick query parameter (no value needed)
Q: What’s the maximum number of results? A: 50,000 records per request (default: 1,000)
Q: What are the supported DNS record types? A: A, AAAA, CNAME, MX, NS, TXT, SOA, PTR, SRV, and more. See Reference: DNS Record Types
Q: Why do results come back in different order each time?
A: Results are not sorted for performance. Sort client-side if needed: | jq -s 'sort_by(.rdata)'
Ready to start? Begin with the Tutorial
Start here: a learning-oriented guide to making your first DETEQTIVE DNS API queries.
Read moreProblem-oriented practical guides for specific tasks with the DETEQTIVE DNS API.
Read moreComplete technical reference: endpoints, parameters, response formats, and error codes.
Read moreDeep dive into passive DNS concepts, API design decisions, and best practices.
Read more