API Documentation

Complete reference for the PayToolbox REST API

Getting Started

The PayToolbox API provides programmatic access to DNS lookups, email verification, and blacklist checking tools. All API endpoints return data in JSON, XML, or CSV format.

Base URL
https://paytoolbox.com//api.php
Quick Example
curl -H "X-API-Key: YOUR_API_KEY" \
     "https://paytoolbox.com//api.php?area=dns&action=lookup-mx&domain=example.com&output=json"
Need an API key? Log in or create an account to get started. API access is available with Pro and Business plans.
Authentication

All API requests require authentication using an API key. You can include your API key in one of two ways:

1. HTTP Header (Recommended)
X-API-Key: mxw_your_api_key_here
2. Query Parameter
https://paytoolbox.com//api.php?apikey=mxw_your_api_key_here&...
Security Note: Using the HTTP header is more secure as it keeps your API key out of server logs and browser history.
Rate Limits

Rate limits are applied per API key on a daily basis. The limit depends on your subscription plan.

Plan Daily Limit Max API Keys
Pro 1,000 requests/day 5 keys
Business 10,000 requests/day 25 keys
Enterprise Unlimited Unlimited
Rate Limit Headers

Every response includes headers indicating your rate limit status:

X-RateLimit-Limit: 1000       # Your daily limit
X-RateLimit-Remaining: 742    # Requests remaining today
X-RateLimit-Reset: 1705536000 # Unix timestamp when limit resets
Rate Limit Exceeded Response

When you exceed your rate limit, you'll receive a 429 Too Many Requests response:

{
    "success": false,
    "error": "Rate limit exceeded",
    "reset_at": "2024-01-18T00:00:00Z"
}
Response Formats

Specify your preferred response format using the output parameter:

output=json

JSON format (default)

output=xml

XML format

output=csv

CSV format

Success Response
{
    "success": true,
    "data": {
        // Response data here
    },
    "cached": false,
    "query_time_ms": 125
}
Error Response
{
    "success": false,
    "error": "Error description here",
    "error_code": "INVALID_DOMAIN"
}
DNS Lookups

Query various DNS record types for any domain.

GET MX Lookup

Get mail exchange (MX) records for a domain.

Endpoint
/api.php?area=dns&action=lookup-mx
Parameters
Parameter Description
domain The domain to query (e.g., example.com)
output Response format: json, xml, or csv (default: json)
Example Request
curl -H "X-API-Key: YOUR_API_KEY" \
     "https://paytoolbox.com//api.php?area=dns&action=lookup-mx&domain=example.com&output=json"
Permission Required
dns.lookup-mx

GET A Record Lookup

Get IPv4 address records for a domain.

Endpoint
/api.php?area=dns&action=lookup-a
Parameters
Parameter Description
domain The domain to query
output Response format: json, xml, or csv (default: json)
Example Request
curl -H "X-API-Key: YOUR_API_KEY" \
     "https://paytoolbox.com//api.php?area=dns&action=lookup-a&domain=example.com&output=json"
Permission Required
dns.lookup-a

GET AAAA Record Lookup

Get IPv6 address records for a domain.

Endpoint
/api.php?area=dns&action=lookup-aaaa
Parameters
Parameter Description
domain The domain to query
output Response format: json, xml, or csv (default: json)
Example Request
curl -H "X-API-Key: YOUR_API_KEY" \
     "https://paytoolbox.com//api.php?area=dns&action=lookup-aaaa&domain=example.com&output=json"
Permission Required
dns.lookup-aaaa

GET NS Record Lookup

Get nameserver records for a domain.

Endpoint
/api.php?area=dns&action=lookup-ns
Parameters
Parameter Description
domain The domain to query
output Response format: json, xml, or csv (default: json)
Example Request
curl -H "X-API-Key: YOUR_API_KEY" \
     "https://paytoolbox.com//api.php?area=dns&action=lookup-ns&domain=example.com&output=json"
Permission Required
dns.lookup-ns

GET TXT Record Lookup

Get TXT records for a domain.

Endpoint
/api.php?area=dns&action=lookup-txt
Parameters
Parameter Description
domain The domain to query
output Response format: json, xml, or csv (default: json)
Example Request
curl -H "X-API-Key: YOUR_API_KEY" \
     "https://paytoolbox.com//api.php?area=dns&action=lookup-txt&domain=example.com&output=json"
Permission Required
dns.lookup-txt

GET CNAME Record Lookup

Get canonical name records for a domain.

Endpoint
/api.php?area=dns&action=lookup-cname
Parameters
Parameter Description
domain The domain to query
output Response format: json, xml, or csv (default: json)
Example Request
curl -H "X-API-Key: YOUR_API_KEY" \
     "https://paytoolbox.com//api.php?area=dns&action=lookup-cname&domain=www.example.com&output=json"
Permission Required
dns.lookup-cname

GET SOA Record Lookup

Get start of authority records for a domain.

Endpoint
/api.php?area=dns&action=lookup-soa
Parameters
Parameter Description
domain The domain to query
output Response format: json, xml, or csv (default: json)
Example Request
curl -H "X-API-Key: YOUR_API_KEY" \
     "https://paytoolbox.com//api.php?area=dns&action=lookup-soa&domain=example.com&output=json"
Permission Required
dns.lookup-soa

GET PTR (Reverse DNS) Lookup

Get the hostname for an IP address.

Endpoint
/api.php?area=dns&action=lookup-ptr
Parameters
Parameter Description
ip The IP address to query
output Response format: json, xml, or csv (default: json)
Example Request
curl -H "X-API-Key: YOUR_API_KEY" \
     "https://paytoolbox.com//api.php?area=dns&action=lookup-ptr&ip=8.8.8.8&output=json"
Permission Required
dns.lookup-ptr

GET SPF Record Lookup

Get and parse SPF records for a domain.

Endpoint
/api.php?area=dns&action=lookup-spf
Parameters
Parameter Description
domain The domain to query
output Response format: json, xml, or csv (default: json)
Example Request
curl -H "X-API-Key: YOUR_API_KEY" \
     "https://paytoolbox.com//api.php?area=dns&action=lookup-spf&domain=example.com&output=json"
Permission Required
dns.lookup-spf

GET DKIM Record Lookup

Get DKIM public key records for a domain.

Endpoint
/api.php?area=dns&action=lookup-dkim
Parameters
Parameter Description
domain The domain to query
selector The DKIM selector (default: "default")
output Response format: json, xml, or csv (default: json)
Example Request
curl -H "X-API-Key: YOUR_API_KEY" \
     "https://paytoolbox.com//api.php?area=dns&action=lookup-dkim&domain=example.com&selector=google&output=json"
Permission Required
dns.lookup-dkim

GET DMARC Record Lookup

Get DMARC policy records for a domain.

Endpoint
/api.php?area=dns&action=lookup-dmarc
Parameters
Parameter Description
domain The domain to query
output Response format: json, xml, or csv (default: json)
Example Request
curl -H "X-API-Key: YOUR_API_KEY" \
     "https://paytoolbox.com//api.php?area=dns&action=lookup-dmarc&domain=example.com&output=json"
Permission Required
dns.lookup-dmarc

GET BIMI Record Lookup

Get Brand Indicators for Message Identification records.

Endpoint
/api.php?area=dns&action=lookup-bimi
Parameters
Parameter Description
domain The domain to query
output Response format: json, xml, or csv (default: json)
Example Request
curl -H "X-API-Key: YOUR_API_KEY" \
     "https://paytoolbox.com//api.php?area=dns&action=lookup-bimi&domain=example.com&output=json"
Permission Required
dns.lookup-bimi

GET MTA-STS Record Lookup

Get MTA Strict Transport Security records.

Endpoint
/api.php?area=dns&action=lookup-mtasts
Parameters
Parameter Description
domain The domain to query
output Response format: json, xml, or csv (default: json)
Example Request
curl -H "X-API-Key: YOUR_API_KEY" \
     "https://paytoolbox.com//api.php?area=dns&action=lookup-mtasts&domain=example.com&output=json"
Permission Required
dns.lookup-mtasts

GET Blacklist Check

Check if an IP or domain is listed on email blacklists.

Endpoint
/api.php?area=dns&action=blacklist-check
Parameters
Parameter Description
q The IP address or domain to check
output Response format: json, xml, or csv (default: json)
Example Request
curl -H "X-API-Key: YOUR_API_KEY" \
     "https://paytoolbox.com//api.php?area=dns&action=blacklist-check&q=1.2.3.4&output=json"
Permission Required
dns.blacklist-check
Email Tools

Email verification and analysis tools.

GET Email Verification

Verify if an email address is valid and deliverable.

Endpoint
/api.php?area=email&action=verify
Parameters
Parameter Description
email The email address to verify
output Response format: json, xml, or csv (default: json)
Example Request
curl -H "X-API-Key: YOUR_API_KEY" \
     "https://paytoolbox.com//[email protected]&output=json"
Permission Required
email.verify

GET Spam Score Check

Analyze email content for spam indicators.

Endpoint
/api.php?area=email&action=checkspamassassin
Parameters
Parameter Description
content The email content/body to analyze
output Response format: json, xml, or csv (default: json)
Example Request
curl -H "X-API-Key: YOUR_API_KEY" \
     "https://paytoolbox.com//api.php?area=email&action=checkspamassassin&content=...&output=json"
Permission Required
email.checkspamassassin
Code Examples
curl -X GET \
  -H "X-API-Key: mxw_your_api_key_here" \
  "https://paytoolbox.com//api.php?area=dns&action=lookup-mx&domain=example.com&output=json"
<?php
$apiKey = 'mxw_your_api_key_here';
$domain = 'example.com';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://paytoolbox.com//api.php?area=dns&action=lookup-mx&domain=$domain&output=json");
curl_setopt($ch, CURLOPT_HTTPHEADER, ["X-API-Key: $apiKey"]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
print_r($data);
import requests

api_key = 'mxw_your_api_key_here'
domain = 'example.com'

response = requests.get(
    'https://paytoolbox.com//api.php',
    params={
        'area': 'dns',
        'action': 'lookup-mx',
        'domain': domain,
        'output': 'json'
    },
    headers={'X-API-Key': api_key}
)

data = response.json()
print(data)
const apiKey = 'mxw_your_api_key_here';
const domain = 'example.com';

fetch(`https://paytoolbox.com//api.php?area=dns&action=lookup-mx&domain=${domain}&output=json`, {
    headers: {
        'X-API-Key': apiKey
    }
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
Error Codes
HTTP Code Error Code Description
400 INVALID_REQUEST Missing or invalid parameters
401 INVALID_API_KEY API key is missing, invalid, or disabled
403 PERMISSION_DENIED API key lacks permission for this endpoint
403 IP_NOT_ALLOWED Request IP not in API key's whitelist
429 RATE_LIMIT_EXCEEDED Daily rate limit reached
500 SERVER_ERROR Internal server error
Need Help?

Have questions about the API or need assistance with integration?

Contact Support