MtrXTools API
Every MtrXTools check is available as a free JSON API: no key, no sign-up. Use it in scripts, monitoring, chat bots and internal tools. Each endpoint is a GET with query parameters, the same ones the tool pages use.
Quick start
curl 'https://www.mtrxtools.com/api/v1/dns-lookup?q=github.com&type=MX'const res = await fetch('https://www.mtrxtools.com/api/v1/dns-lookup?q=github.com&type=MX');
const body = await res.json();
if (!body.ok) throw new Error(body.error);
console.log(body.data);{
"ok": true,
"ms": 41,
"data": { ... }
}Errors return { "ok": false, "error": "..." } with an HTTP status: 400 for bad input, 403 for targets that are not allowed (private and internal addresses are never contacted), 422 when the input can't be checked, 429 when rate limited, and 502 to 504 when the target or an upstream service fails.
MCP server for AI assistants
The same checks are available to AI assistants and agents through the Model Context Protocol: 28 read-only tools, from DNS lookups and certificate checks to BGP routes and error explanations. It is a remote server over Streamable HTTP, with no key or sign-up, at
https://www.mtrxtools.com/api/mcpclaude mcp add --transport http mtrxtools https://www.mtrxtools.com/api/mcp{
"mcpServers": {
"mtrxtools": { "url": "https://www.mtrxtools.com/api/mcp" }
}
}npx -y mcp-remote https://www.mtrxtools.com/api/mcpIn Claude on the web or desktop, add it as a custom connector with the server URL. Tool calls count against the same per-IP rate limits as the API below, private and internal addresses are refused, and each result includes a link to the MtrXTools page for the same check. Tools: dns_lookup, reverse_dns, dns_report, dns_propagation, ssl_checker, http_headers, csp_evaluator, cookie_inspector, cors_tester, revocation_check, security_txt, ct_search, hsts_preload, website_health, email_auth, mta_sts, bimi, blocklists, rpki, asn_explorer, rdap, whois, ip_info, cloud_ip, port_check, ping, ntp_test, explain_error.
Rate limits and fair use
- 40 requests a minute per IP address for heavy checks: SSL/TLS, HTTP headers, website health, port check and ping. A full website health report (
section=all) counts as 8. - 60 requests a minute for everything else. IPv6 clients are counted per /64.
- Every response has
RateLimit-Limit,RateLimit-RemainingandRateLimit-Resetheaders; a 429 also hasRetry-After. - Use it for your own diagnostics and integrations. Don't use it to scan networks you don't own. Clients that cause excessive load may be blocked.
- Inputs and results are not stored. CORS is open, so browser apps on any site can call it.
Versioning
Paths start with /api/v1. Within v1 the parameters and the ok/data/error envelope stay stable; objects inside data may gain new fields, so ignore ones you don't know. Breaking changes will get a new version. The machine-readable description is at /api/v1/openapi.json (OpenAPI 3.1), and /api/v1 lists the endpoints.
Endpoints
DNS lookup
GET /api/v1/dns-lookupQuery DNS records from a public resolver or straight from the domain's authoritative nameservers, with TTLs and flags.
qrequired | Domain name. |
|---|---|
type | Record type. ALL returns the common types.Values: ALL, A, AAAA, CNAME, MX, NS, TXT, SOA, CAA, SRV, PTR, DS, DNSKEY, TLSA, NAPTR, SSHFP (default A) |
resolver | Resolver to ask, or authoritative to skip caches.Values: cloudflare, google, quad9, opendns, authoritative (default cloudflare) |
dnssec | Set to 1 to request DNSSEC records and signatures.Values: 1 |
Reverse DNS
GET /api/v1/reverse-dnsFind the PTR hostname for an IPv4 or IPv6 address and check that it resolves back to the same address.
qrequired | IPv4 or IPv6 address. |
|---|---|
resolver | Resolver to ask.Values: cloudflare, google, quad9, opendns (default cloudflare) |
DNS health report
GET /api/v1/dns-reportA graded report on how a zone is delegated and served: the parent's NS set, glue and DS against the zone's own, every nameserver asked directly (authoritative answer, SOA serial, TCP, open recursion, network and AS), SOA timers, MX and CAA sanity, and the DNSSEC chain from DS to DNSKEY with signature expiry.
qrequired | Domain. A name inside a zone is checked as that zone. |
|---|
DNS propagation
GET /api/v1/dns-propagationAsk 22 resolvers on five continents and the zone's own nameservers, group the answers, and return when each stale cached copy expires, plus the parent zone's delegation.
qrequired | Domain name. |
|---|---|
type | Record type.Values: A, AAAA, CNAME, MX, NS, TXT, CAA (default A) |
expect | The value you are waiting for (an IP, hostname or TXT fragment). Without it, resolvers are compared with what the nameservers serve. |
SSL/TLS checker
GET /api/v1/ssl-checkerRead the certificate chain a server sends, check expiry, hostname match, trust and key, test TLS 1.0 to 1.3, and grade it.
qrequired | Hostname, URL or host:port. Implicit TLS only (no STARTTLS). |
|---|---|
port | Port, if not given in q.Default: 443 |
ciphers | Set to 1 to scan instead: the cipher suites accepted on each protocol (each marked safe or unsafe), protocol details read from ordinary handshakes, and known attacks inferred from them. Takes a few seconds, up to about 25.Values: 1 |
HTTP headers
GET /api/v1/http-headersFollow every redirect, return each hop's status, headers and timing, and grade the security headers of the final page.
qrequired | URL or hostname. |
|---|
CSP evaluator
GET /api/v1/csp-evaluatorEvaluate the Content-Security-Policy of a URL (headers, report-only and <meta> policies, with the page fetched twice to check nonces change) or of a policy passed directly. Returns each policy parsed into directives and sources with risk notes, checks for inline scripts, wildcards, bypassable allowlists, plugins, base-uri, framing, reporting and syntax mistakes, and an overall verdict.
qrequired | A URL or domain, or the policy itself (starting with a directive such as script-src). |
|---|
CORS tester
GET /api/v1/cors-testerSend the CORS preflight a browser would send for a cross-origin request from the given origin (when one is needed), then a GET with that Origin, and check both responses the way the browser does: Access-Control-Allow-Origin, -Methods, -Headers, -Credentials, -Max-Age, Vary and exposed headers. Requests that could change data are never sent; only their preflight is. Returns each exchange's headers and checks, an allowed or blocked verdict and equivalent curl commands.
qrequired | The URL of the API endpoint. |
|---|---|
origin | The origin of the page making the request. Default https://example.com. |
method | The request method. Default GET.Values: GET, HEAD, POST, PUT, PATCH, DELETE |
headers | Request header names the page sets, comma-separated. |
credentials | Set to 1 for a request with cookies or HTTP authentication (fetch credentials: 'include').Values: 1 |
OCSP / revocation check
GET /api/v1/revocation-checkCheck whether the certificate a server presents has been revoked: the stapled OCSP response, a query to the CA's OCSP responder and a download of its CRL (up to 10 MB), each with status, this and next update, timings and signature verification against the issuer, plus Must-Staple and an overall verdict (good, revoked or unknown).
qrequired | Hostname, URL or host:port. Implicit TLS only (no STARTTLS). |
|---|---|
port | Port, if not given in q. Default 443. |
security.txt validator
GET /api/v1/security-txtFind a domain's security.txt (/.well-known/security.txt, or the legacy /security.txt), following redirects, and validate it against RFC 9116: Content-Type, the required Contact and Expires fields, HTTPS addresses, Canonical, Encryption, Preferred-Languages, OpenPGP signing, unknown fields and stray lines. Returns the parsed fields, the file, checks and a corrected file.
qrequired | Domain or URL. |
|---|
Certificate Transparency search
GET /api/v1/ct-searchList the unexpired certificates logged in Certificate Transparency for a domain and its subdomains (from SSLMate Cert Spotter, with crt.sh as a fallback; cached for 30 minutes). Returns each certificate's names, issuer, validity and revocation, the issuers checked against the domain's CAA records, every host name found with its latest expiry, and checks for unauthorised issuers and names expiring with no replacement.
qrequired | Domain. |
|---|---|
exact | Set to 1 to search only this name (and wildcards covering it), not its subdomains.Values: 1 |
HSTS preload checker
GET /api/v1/hsts-preloadCheck each hstspreload.org requirement for a domain (trusted certificate, HTTP redirecting to HTTPS on the same host, one Strict-Transport-Security header with max-age of at least a year, includeSubDomains and preload, HTTPS on www), with the redirect hops, the domain's preload list status and hstspreload.org's own errors and warnings.
qrequired | Domain or URL. A subdomain is checked as its registrable domain. |
|---|
Website health
GET /api/v1/website-healthA graded site report: DNS, every A/AAAA address, the http/https and www/apex redirect matrix, TLS, accepted cipher suites, headers, domain expiry and content basics.
qrequired | Domain or URL. |
|---|---|
section | all returns every section and the overall grade in one response (counts as 9 requests against the rate limit). A single section returns just that part; ciphers lists the cipher suites accepted on each protocol, each marked safe or unsafe, plus protocol details read from ordinary handshakes (renegotiation, downgrade protection, compression, ALPN, resumption, stapling, named groups, DH parameters) and known attacks inferred from them. Without it, only the resolved target and section list are returned.Values: all, dns, nodes, entry, tls, ciphers, domain, content, edge |
SPF, DKIM & DMARC
GET /api/v1/email-authCheck SPF (with the DNS lookup count), find DKIM keys, read the DMARC policy, MTA-STS, TLS-RPT and BIMI, and grade the setup.
qrequired | Domain or email address. |
|---|---|
selectors | Extra DKIM selectors to try, comma-separated, e.g. s1,mail2026. Common ones are always tried. |
MTA-STS & TLS-RPT
GET /api/v1/mta-stsCheck the _mta-sts record, fetch and validate the policy file (certificate, redirects, content type, syntax), match its mx patterns against the domain's MX hosts, and read the TLS-RPT record and its report destinations.
qrequired | Domain or email address. |
|---|
BIMI checker
GET /api/v1/bimiCheck the BIMI record (at the domain or its organisational domain), fetch the logo and check it against the SVG Tiny PS profile, fetch and verify the mark certificate (BIMI usage, domain, expiry, chain, mark type, whether its embedded logo matches), and confirm DMARC enforcement. Includes the logo as a data: URI.
qrequired | Domain or email address. |
|---|---|
selector | BIMI selector, for senders that set a BIMI-Selector header. Defaults to "default". |
Blocklist check
GET /api/v1/blocklistsCheck an IP address against 13 DNS blocklists, or a domain against 3 domain blocklists plus its mail servers' and website's addresses against the IP lists. Each result is listed, clean, or not verified when a list doesn't confirm its own test entry.
qrequired | IPv4 or IPv6 address, domain, or email address. |
|---|
RPKI validity
GET /api/v1/rpkiRPKI route origin validation (valid, invalid_asn, invalid_length or unknown) for the routes covering an IP address or a domain's addresses, a prefix, or every prefix an AS announces, with the deciding ROAs, RIS visibility, and ROAs whose maxLength is longer than announced. Data from RIPEstat.
qrequired | IP address, prefix, AS number (AS13335) or domain. |
|---|---|
asn | Validate against this origin AS instead of the one seen in BGP, to test a planned announcement (IP or prefix only). |
ASN & prefix explorer
GET /api/v1/asn-explorerWhat the global routing table says about an AS number or a prefix (or the route covering an IP address or domain), from RIPEstat. For an AS: holder and registry, announced IPv4 and IPv6 prefixes, upstream and downstream neighbours with names, and prefixes missing from the IRR. For a prefix: origins with their IRR route objects, visibility across RIS peers, upstreams and sample AS paths from collectors worldwide, covering and more-specific routes, a week of update activity and the origin history. With checks for single upstreams, missing IRR objects, multiple origins, foreign more-specifics, over-specific prefixes and flapping.
qrequired | AS number (AS13335 or 13335), prefix, IP address or domain. |
|---|
RDAP lookup
GET /api/v1/rdapRegistration data over RDAP: registrar, dates, status, nameservers and abuse contacts for a domain, IP address or range, or AS number.
qrequired | Domain, IP address, CIDR or AS number. |
|---|
WHOIS
GET /api/v1/whoisQuery WHOIS servers directly, following referrals from IANA to the registry and registrar, and return each raw response.
qrequired | Domain or IP address. |
|---|
IP info
GET /api/v1/ip-infoNetwork, AS number, approximate location, address type and reverse DNS for an IP address. Hostnames are resolved first.
qrequired | IP address or hostname. |
|---|
Cloud IP owner
GET /api/v1/cloud-ipWhich cloud, CDN or crawler owns an address, from each provider's published ranges, with service and region. Verifies Googlebot and Bingbot.
qrequired | Up to 20 IP addresses or hostnames, separated by commas or spaces. |
|---|
What's my IP
GET /api/v1/my-ipThe public IP address the request came from, with its network and approximate location. For scripts, /api/v1/my-ip/ipv4, /api/v1/my-ip/ipv6 and /api/v1/my-ip/ip return just the address as plain text (add ?format=json for {"ip": "..."}). A server sees only the family a request arrives over, so /ipv4 and /ipv6 answer 422 with a hint when the connection used the other one; force it with curl -4 or curl -6.
Port check
GET /api/v1/port-checkWhether TCP ports are open, closed or filtered, with connect times and the banner a service sends first. Up to 20 ports.
qrequired | Hostname or IP address. |
|---|---|
preset | Port set to test when ports is empty.Values: common, web, mail, remote, db (default common) |
ports | Ports and ranges, comma-separated (max 20). |
Ping (TCP)
GET /api/v1/pingRound-trip time to a host from timed TCP handshakes: min, average, max, jitter and loss. Works where ICMP is blocked.
qrequired | Hostname, IP address or host:port. |
|---|---|
port | TCP port, if not given in q.Default: 443 |
count | Attempts, 1 to 10.Default: 5 |
NTP test
GET /api/v1/ntp-testQuery an NTP server over UDP 123: clock offset, delay, stratum, reference, leap status and root distance, over several samples.
qrequired | NTP server hostname or IP address. |
|---|
Error explainer
GET /api/v1/explain-errorMatch an error message or log line against MtrXTools's error library: what it means, causes, fixes, and the check that confirms it.
textrequired | Error message or log line, up to 4,000 characters. |
|---|