# SRV Record Parser API

> SRV Record Parser analyzes DNS SRV records and extracts service location information including priority, weight, port, and target server details.

**Endpoint:** `POST https://api.apiverve.com/v1/srvparser`  
**Category:** Reference Data  
**Cost:** 2 credits per call  
**Canonical page:** https://apiverve.com/marketplace/srvparser

## Overview

An SRV record parser API that breaks a DNS service record into its parts and explains what each one means. Paste an SRV record such as _minecraft._tcp.example.com. 3600 IN SRV 0 5 25565 mc.example.com. to see each field explained, including the service, protocol, port and target, along with the TTL and DNS class.

It is useful wherever SRV records are written by hand or read from a zone file: checking a record for a game server, VoIP or SIP trunk, XMPP chat, Kerberos or LDAP before it goes live, documenting existing records, or building a DNS management screen that shows records in plain language.

The Free plan returns the record name split into service, protocol and domain, plus the TTL, class and a validity flag. Paid plans add the priority, weight, port and target host, recognition of common services like HTTP, XMPP, SIP and the mail protocols with their usual default ports, and short plain-English explanations of the priority, weight and connection target.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl -X POST "https://api.apiverve.com/v1/srvparser" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"record":"_http._tcp.example.com. 86400 IN SRV 10 60 80 server.example.com."}'
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `record` | string | Yes | The SRV record string to parse. A full record set, one record per line, is accepted; the top-level fields describe the first record and records/priority_groups cover all of them |

## Response fields

- `raw_record` — string · Original SRV record string provided for parsing
- `parsed` — object
  - `parsed.name` — string · Full SRV record name with trailing dot
  - `parsed.service` — string · Service identifier (e.g., _http, _xmpp, _sip)
  - `parsed.protocol` — string · Protocol type (e.g., tcp, udp, tls)
  - `parsed.domain` — string · Domain name with trailing dot
  - `parsed.ttl` — number · Time-to-live value in seconds
  - `parsed.class` — string · DNS class (typically IN for Internet)
  - `parsed.priority` — number · Priority value (lower values preferred) · (premium)
  - `parsed.weight` — number · Weight for load balancing among same priority · (premium)
  - `parsed.port` — number · Port number for service connection · (premium)
  - `parsed.target` — string · Target hostname without trailing dot · (premium)
- `service_info` — object · Information about the recognized service type · (premium)
  - `service_info.name` — string · Human-readable service name (e.g., HTTP, XMPP) · (premium)
  - `service_info.description` — string · Service description and use case · (premium)
  - `service_info.default_port` — number · Default port for identified service · (premium)
- `interpretation` — object · Human-readable interpretation of SRV record values · (premium)
  - `interpretation.priority_explanation` — string · Human-readable explanation of priority level · (premium)
  - `interpretation.weight_explanation` — string · Human-readable explanation of weight value · (premium)
  - `interpretation.target_explanation` — string · How to connect to target with port · (premium)
- `is_valid` — boolean · Whether record is validly formatted and parsed

## Sample response

```json
{
  "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
  }
}
```

## 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

## SDKs

- **npm** — `npm install @apiverve/srvparser` (https://www.npmjs.com/package/@apiverve/srvparser)
- **NuGet** — `dotnet add package APIVerve.API.SRVRecordParser` (https://www.nuget.org/packages/APIVerve.API.SRVRecordParser)
- **Source** — https://github.com/apiverve/srvparser-api

## More

- Full reference: https://docs.apiverve.com/ref/srvparser
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
