API reference
DNS Lookup
A plain resolver behind the same API key: ask for one record type or pass ALL to get every common type in a single call. Handy for verifying MX and SPF before mailing, or for pulling the A record you are about to run through IP reputation.
POST
/api/dns-lookupCosts 1 creditAPI keyDNS record lookup
Record types
| record_type | Returns |
|---|---|
| A · AAAA | IPv4 / IPv6 addresses |
| MX | Mail exchangers with priority |
| NS | Authoritative name servers |
| TXT | Text records (SPF, DKIM, DMARC, verification tokens) |
| CNAME | Canonical name |
| SOA | Start of authority (serial, refresh, retry, expire, TTL) |
| ALL | Every type above in one call (default) |
Request
| Field | Type | Description |
|---|---|---|
| domain* | string | Domain name to query |
| record_type | string | Record type(s) or ALLdefault "ALL" |
Authenticate with API key. Send it as the X-API-Key header.
POST /api/dns-lookup
curl -X POST "https://api.senapati.io/api/dns-lookup" \
-H "X-API-Key: $SENAPATI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"domain":"example.com","record_type":"A"}'Response
Every success is wrapped in { "data": … } with a request_id; the fields below describe data. See Errors for the failure shape.
response: 200 OKDNSLookupData
{"request_id": "req_8f2c1a7e","timestamp": "2026-08-27T12:00:31.948809+00:00","data": {"domain": "example.com","records": {},"elapsed_ms": 10078}}
| Field | Type | Description |
|---|---|---|
| domain* | string | |
| records | object | |
| elapsed_ms | integer | default 0 |
Errors
- 401missing or invalid API key / token
- 402not enough credits on the account
- 422the request body or a parameter failed validation
- 429plan rate limit exceeded
Notes
records is keyed by lower-cased type; a type with no answer is simply absent. A domain that does not resolve at all returns an empty records object, not an error.
- One credit per call whichever type you ask for, so
ALLis the best value.