Docs/APIs/SRV Record Parser

SRV Record Parser

Parse DNS SRV records

OperationalCredits 1 per callp50 228msReference DataStar

Overview

Includes recognition of common services like HTTP, XMPP, SIP, and email protocols with detailed explanations of priority and weight values.

Endpoint

One host, one path per API. The block below shows this call in four languages; every one of them is the same HTTP request. Making requests covers the timeouts, retries and parameter rules that apply to all of them. The SDKs wrap the same call in a typed client.

POSThttps://api.apiverve.com/v1/srvparser
curl -X POST https://api.apiverve.com/v1/srvparser \
  -H "x-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
  "record": "_http._tcp.example.com. 86400 IN SRV 10 60 80 server.example.com."
}'
const res = await fetch('https://api.apiverve.com/v1/srvparser', {
  method: 'POST',
  headers: {
    'x-api-key': 'your_api_key_here',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "record": "_http._tcp.example.com. 86400 IN SRV 10 60 80 server.example.com."
}),
});

if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);

const { data } = await res.json();
console.log(data);
import requests

res = requests.post(
    "https://api.apiverve.com/v1/srvparser",
    headers={"x-api-key": "your_api_key_here"},
    json={
    "record": "_http._tcp.example.com. 86400 IN SRV 10 60 80 server.example.com."
},
    timeout=15,
)
res.raise_for_status()

print(res.json()["data"])
package main

import (
	"fmt"
	"io"
	"net/http"
	"strings"
)

func main() {
	body := strings.NewReader(`{
  "record": "_http._tcp.example.com. 86400 IN SRV 10 60 80 server.example.com."
}`)
	req, _ := http.NewRequest("POST", "https://api.apiverve.com/v1/srvparser", body)
	req.Header.Set("Content-Type", "application/json")
	req.Header.Set("x-api-key", "your_api_key_here")

	res, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer res.Body.Close()

	out, _ := io.ReadAll(res.Body)
	fmt.Println(string(out))
}

Replace your_api_key_here with the key from your dashboard. When the inputs arrive as a list rather than one at a time, batch requests run up to 200 of them through this same API in a single call.

Authentication

Send your key in the x-api-key header. That is the only auth step — there is no token exchange and no per-endpoint scope to configure. Authentication covers creating, rotating and revoking keys.

401 is the only auth verdict

A 401 means the key is missing, invalid or expired. A 403 means the key is valid but not permitted here — blocked by a key restriction or an IP allow-list. Running out of credits is a 429.

Parameters

Sent as JSON in the request body. Premium parameters are accepted on every plan but only take effect on plans that include them.

ParameterTypeDescription
recordRequiredstringThe SRV record string to parse

Response

Every API returns the same three top-level keys, so one response handler covers your whole integration: status, error and data. Only data changes shape. Response format covers the envelope, the other output formats and how premium fields are withheld.

Sample response
{
  "status": "ok",
  "error": null,
  "data": {
    "raw_record": "_http._tcp.example.com. 86400 IN SRV 10 60 80 server.example.com.",
    "parsed": {
      "name": "_http._tcp.example.com.",
      "service": "_http",
      "protocol": "tcp",
      "domain": "example.com.",
      "ttl": 86400,
      "class": "IN",
      "priority": 10,
      "weight": 60,
      "port": 80,
      "target": "server.example.com"
    },
    "service_info": {
      "name": "HTTP",
      "description": "Web service",
      "default_port": 80
    },
    "interpretation": {
      "priority_explanation": "Priority level 10 (lower is better)",
      "weight_explanation": "Weight 60 for load balancing",
      "target_explanation": "Connect to server.example.com:80"
    },
    "is_valid": true
  }
}

Response fields

Paths are relative to data. Premium fields are absent rather than zeroed on plans that do not include them, so check for presence instead of comparing to 0.

FieldTypeExampleDescription
raw_recordstring"_http._tcp.example.com. 86400 IN SRV 10 60 80 server.example.com."Original SRV record string provided for parsing
parsedobject{...}
namestring"_http._tcp.example.com."Full SRV record name with trailing dot
servicestring"_http"Service identifier (e.g., _http, _xmpp, _sip)
protocolstring"tcp"Protocol type (e.g., tcp, udp, tls)
domainstring"example.com."Domain name with trailing dot
ttlnumber86400Time-to-live value in seconds
classstring"IN"DNS class (typically IN for Internet)
priorityPremiumnumber10Priority value (lower values preferred)
weightPremiumnumber60Weight for load balancing among same priority
portPremiumnumber80Port number for service connection
targetPremiumstring"server.example.com"Target hostname without trailing dot
service_infoPremiumobject{...}Information about the recognized service type
namePremiumstring"HTTP"Human-readable service name (e.g., HTTP, XMPP)
descriptionPremiumstring"Web service"Service description and use case
default_portPremiumnumber80Default port for identified service
interpretationPremiumobject{...}Human-readable interpretation of SRV record values
priority_explanationPremiumstring"Priority level 10 (lower is better)"Human-readable explanation of priority level
weight_explanationPremiumstring"Weight 60 for load balancing"Human-readable explanation of weight value
target_explanationPremiumstring"Connect to server.example.com:80"How to connect to target with port
is_validbooleantrueWhether record is validly formatted and parsed

Errors

Read the HTTP status first, then error for the specific reason. The body names the parameter that has to change. Error handling covers the full status list and which of them are worth retrying.

StatusMeaningWhat to do
400Input was rejectedRead error; it names the parameter.
401Key missing or invalidCheck the header name and the key value.
403Key valid, but not permittedA key restriction or IP allow-list; see key scoping.
429Rate limited, or out of creditsRead error to tell them apart; see rate limits.

Use cases

Service Discovery
Parse DNS SRV records for service discovery in distributed systems, microservices, and load-balanced environments
Network Diagnostics
Build network diagnostic tools that analyze SRV records for troubleshooting connectivity and service availability issues
Configuration Analysis
Analyze service configuration in DNS including priority, weight, port, and target information for optimization
Record Validation
Validate SRV record formatting and structure to ensure compliance with RFC 2782 standards and best practices

Other ways to use SRV Record Parser

Set up SRV Record Parser on APIVerve, or reach the same source a different way. Your APIVerve account and credits work on all of them — one key, one balance.

Give it to an AI agentConnect over MCP and your agent calls it as a native tool — Claude, Cursor, ChatGPT.VerveKitReference →
Use it in Google Sheets or ExcelA =VERVE() formula fills a column — no script, no export, recalculates in place.VerveSheetsReference →
Ground an agent on itA cited, machine-checkable fact your model can't produce on its own.VerveContextReference →

More in Reference Data:

Was this page helpful?