API Documentation
Access our RESTful API to integrate IPv6 network diagnostic tools into your applications. All endpoints return JSON responses and support both IPv4 and IPv6.
Base URL
Bash
https://ping6.net/api/v1HTTPS Only
All API requests must use HTTPS for secure communication.
CORS Enabled
Cross-origin requests are supported from any domain.
Authentication
Most endpoints are available without authentication. For higher rate limits and access to premium features, use an API key.
Anonymous
No authentication required. Subject to lower rate limits.
API Key
Include your API key in the X-API-Key header for higher rate limits.
Bash
curl -X GET "https://ping6.net/api/v1/ping/google.com" \ -H "X-API-Key: your-api-key-here"Rate Limits
API requests are rate-limited to ensure fair usage and service availability.
| Tier | Requests | Notes |
|---|---|---|
| Anonymous | 100 / minute | IP-based limiting. Shared across all anonymous users from the same IP. |
| API Key | 1,000 / minute | Per API key. Contact us for higher limits. |
Rate Limit Headers
X-RateLimit-LimitMaximum requests allowed per windowX-RateLimit-RemainingRemaining requests in current windowX-RateLimit-ResetUnix timestamp when the rate limit resetsError Handling
The API uses conventional HTTP response codes to indicate success or failure.
| Code | Status | Description |
|---|---|---|
| 400 | Bad Request | Invalid request parameters or malformed request body. |
| 401 | Unauthorized | Invalid or missing API key for protected endpoints. |
| 404 | Not Found | The requested resource or endpoint does not exist. |
| 429 | Too Many Requests | Rate limit exceeded. Wait before making more requests. |
| 500 | Internal Server Error | Server error. Please try again later or contact support. |
JSON
{ "error": { "code": "INVALID_ADDRESS", "message": "The provided address is not a valid IPv6 address", "details": { "address": "invalid-address" } }}API Endpoints
GET
/myipGet My IP Address
Returns the public IP address of the client making the request. Automatically detects whether the connection is IPv4 or IPv6.
Example Response
JSON
{ "ip": "2001:db8:85a3::8a2e:370:7334", "version": 6, "isIPv6": true}Code Examples
cURL
curl -X GET "https://ping6.net/api/v1/myip" \ -H "Accept: application/json"GET
/validateValidate IPv6 Address
Validates an IPv6 address and returns detailed information about its format, type, and canonical representations.
Parameters
| Name | Type | In | Description |
|---|---|---|---|
address* | string | query | The IPv6 address to validate |
Example Response
JSON
{ "valid": true, "type": "Documentation", "compressed": "2001:db8::1", "expanded": "2001:0db8:0000:0000:0000:0000:0000:0001"}Code Examples
cURL
curl -X GET "https://ping6.net/api/v1/validate?address=2001:db8::1" \ -H "Accept: application/json"GET
/dns/{hostname}DNS Lookup
Query DNS records for a hostname using configurable DNS resolvers. Supports all common record types with special focus on AAAA records for IPv6.
Parameters
| Name | Type | In | Description |
|---|---|---|---|
hostname* | string | path | The hostname to query |
type | enum: AAAA | A | MX | TXT | NS | CNAME | SOA | PTR | query | DNS record type to query(default: AAAA) |
resolver | enum: cloudflare | google | quad9 | query | DNS resolver to use for the query(default: cloudflare) |
Example Response
JSON
{ "hostname": "google.com", "records": [ { "type": "AAAA", "value": "2607:f8b0:4004:800::200e", "ttl": 300 } ], "resolver": "cloudflare", "queryTime": 23}Code Examples
cURL
curl -X GET "https://ping6.net/api/v1/dns/google.com?type=AAAA&resolver=cloudflare" \ -H "Accept: application/json"GET
/ping/{target}BetaPing Target
Send ICMP echo requests to an IPv6 address or hostname and receive latency statistics. Requires API key authentication.
Parameters
| Name | Type | In | Description |
|---|---|---|---|
target* | string | path | IPv6 address or hostname to ping |
count | string | query | Number of ping packets to send (1-10)(default: 4) |
Example Response
JSON
{ "target": "2001:4860:4860::8888", "ip": "2001:4860:4860::8888", "results": [ { "seq": 1, "ttl": 117, "rtt": 12.4 }, { "seq": 2, "ttl": 117, "rtt": 11.8 }, { "seq": 3, "ttl": 117, "rtt": 12.1 }, { "seq": 4, "ttl": 117, "rtt": 11.9 } ], "stats": { "transmitted": 4, "received": 4, "loss": 0, "min": 11.8, "avg": 12.05, "max": 12.4 }}Code Examples
cURL
curl -X GET "https://ping6.net/api/v1/ping/2001:4860:4860::8888?count=4" \ -H "Accept: application/json" \ -H "X-API-Key: your-api-key"GET
/traceroute/{target}BetaTraceroute
Trace the network path to a destination, showing each hop along the route with latency information. Requires API key authentication.
Parameters
| Name | Type | In | Description |
|---|---|---|---|
target* | string | path | IPv6 address or hostname to trace |
maxHops | string | query | Maximum number of hops to trace (1-64)(default: 30) |
Example Response
JSON
{ "target": "google.com", "ip": "2607:f8b0:4004:800::200e", "hops": [ { "hop": 1, "ip": "2001:db8::1", "hostname": "router.local", "rtt": 1.2 }, { "hop": 2, "ip": "2001:db8:1::1", "hostname": "isp-gateway.net", "rtt": 5.4 }, { "hop": 3, "ip": "2607:f8b0:4004:800::200e", "hostname": "google.com", "rtt": 12.8 } ]}Code Examples
cURL
curl -X GET "https://ping6.net/api/v1/traceroute/google.com?maxHops=30" \ -H "Accept: application/json" \ -H "X-API-Key: your-api-key"