Network & DNS
GET
/api/v1/mx-lookupPacketFlo MX Lookup API
Cost: 1 credit per request
The mail servers that accept email for a domain, in priority order.
| Parameter | Type | Required | Description |
|---|---|---|---|
domain | string | Yes | Domain to look up. |
Example request
curl "https://packetflo.io/api/v1/mx-lookup?domain=example.com&api_key=YOUR_API_KEY"
Example response
{ "ok": true, "data": { "domain": "example.com", "hosts": [ { "priority": 5, "exchange": "mxa.example.com", "ip": "172.65.169.99", "provider": null }, { "priority": 10, "exchange": "mxb.example.com", "ip": "172.65.65.66", "provider": null } ] }, "meta": { "tool": "mx-lookup", "version": "v1" } }
Reading the result
Lists mail exchangers in priority order. An empty list can indicate missing MX records or a DNS lookup failure.
Response fields
| Field | What it tells you |
|---|---|
domain | The domain queried. |
hosts[].priority / exchange | MX preference and mail-server hostname. Lower priority values are preferred. |
hosts[].ip / provider | A resolved address, preferring IPv4, and inferred provider information. The address is null if resolution fails. |
Scope and limits
Reads DNS and resolves MX hostnames. It does not connect to SMTP, send mail or verify that a mailbox exists. Provider attribution is an inference.
Authentication and errors
Send your key in the x-api-key header, or the supported api_key query parameter. Each request uses 1 credit from the key's shared 300-credit rolling 24-hour budget. Credits are charged before parameter validation. Successful responses and quota errors include usage headers; GET and OPTIONS support CORS.
| API status | Meaning |
|---|---|
200 | The diagnostic returned a result in data, with ok: true and version information in meta. Read the diagnostic fields to determine the target's condition. |
400 | Invalid or blocked input, or a lookup/check failure that could not be returned as a diagnostic result. Read error for details. |
401 | Missing, invalid or revoked API key. |
429 | The request would exceed the key's available credit budget. |