← Back to API Ninjas
GET/v1/mxlookup

Retrieve MX records for a domain

Returns the mail-exchange (MX) records for a `domain`, showing which servers accept its email. For other record types use /dnslookup.

API Ninjas·$0.001 per call

Example code

// Using @orth/sdk - The simplest way to call APIs // Install: npm install @orth/sdk import Orthogonal from "@orth/sdk"; const orthogonal = new Orthogonal({ apiKey: process.env.ORTHOGONAL_API_KEY, }); const output = await orthogonal.run({ api: "api-ninjas", path: "/v1/mxlookup", query: { "domain": "example" } }); console.log(output);

Query parameters

domainrequired
string

Valid domain to check (e.g. x.com). All top-level domains are supported.

    Orthogonal - Giving AI agents the tools they need.