VASTlint

How to validate VAST XML

Paste a VAST URL or XML into the VAST tag validator to check it against the spec. Open the VAST tag tester to preview the ad. You can also run the same validation rules from the CLI or in CI.

A VAST tag, also called a VAST XML document, is the IAB Tech Lab standard response that tells a video player how to find, display, and track an ad. A single malformed field, missing <Impression>, bad duration format, or deprecated VPAIDpattern can silently kill an impression. This guide covers the fastest way to validate VAST XML online plus the CLI and in-process options for pipelines.

Choose the right VAST debugging tool

Use the validator for spec checks on a VAST URL or XML, the tester for creative preview, and the inspector for hop-by-hop wrapper debugging.

Option 1: Online VAST validator (fastest)

The quickest way is to paste your tag into the vastlint web validator. It runs spec-derived validation across IAB VAST 2.0 through 4.4 and returns a structured report in under a millisecond. Tags you paste may be stored (IDs and IPs stripped) to improve rules; opt out on the validator page.

When you paste a URL, the validator fetches the response and checks its XML. To preview the creative, use the VAST Tag Tester. To follow a wrapper chain, use the VAST Inspector.

  1. Open vastlint.org/validate
  2. Paste a VAST URL or XML, or drop an .xml file
  3. Press ⌘↵ or click Validate
  4. Review errors, warnings, and advisory messages (each linked to the rule that fired)

Option 2: CLI (for CI/CD pipelines)

Install the vastlint CLI with Homebrew or Cargo and validate any file or stream from the command line. This is the standard approach for validating tags in a build pipeline or pre-flight check.

# Homebrew (macOS / Linux)
brew install aleksUIX/tap/vastlint

# Cargo
cargo install --locked --git https://github.com/aleksUIX/vastlint-tools --tag cli-v0.19.1 vastlint-cli

# Validate a file
vastlint check tag.xml

# Validate from stdin (pipe from curl, etc.)
curl -s https://example.com/vast.xml | vastlint check -

# Exit code 0 = valid, 1 = errors found
# Use --format json for machine-readable output
vastlint check tag.xml --format json

For a creative review, run vastlint explain tag.xml -o report.html. The annotated report guide walks through the declared assets, placement, and tracking in a sample pause ad.

Option 3: Rust library (in-process, zero overhead)

For ad servers, SSPs, and DSPs that need inline validation at bid time, embed vastlint-core directly. It validates production-size VAST tags (17–44 KB) in 363 µs to 2.1 ms on a single core.

# Cargo.toml
[dependencies]
vastlint-core = "0.4"
use vastlint_core::validate;

let result = validate(vast_xml_bytes);
for issue in &result.issues {
    println!("{}: {} (line {})", issue.severity, issue.message, issue.line);
}

Option 4: Go binding

A Go binding wraps the same Rust core via CGo. Use it in Go-based ad servers without spawning a subprocess.

import vastlint "github.com/aleksUIX/vastlint-go"

result, err := vastlint.Validate(xmlBytes)
if err != nil {
    log.Fatal(err)
}
for _, issue := range result.Issues {
    fmt.Printf("%s: %s\n", issue.Severity, issue.Message)
}

What VAST validation checks

VAST uses XML, but XML parsing and VAST validation answer different questions. The VAST vs XML guide shows the syntax, schema, specification, and live playback checks side by side.

vastlint applies spec-derived checks from the published IAB VAST XSD schemas. Key checks include:

  • Required elements: <Impression>, <Duration>, <MediaFile> (for inline ads), <VASTAdTagURI> (for wrappers)
  • Duration format: must be HH:MM:SS or HH:MM:SS.mmm
  • URL validity: all tracking pixels, media URLs, and click-through URLs
  • Version consistency: elements from VAST 4.x used in a 3.0 tag, or vice versa
  • Deprecated features: VPAID, AdServingId misuse, old delivery attributes
  • Duplicate impressions: multiple <Impression> URIs that are identical
  • SkipOffset: value must be a valid time offset or percentage

Understanding validation results

Every issue has a severity level:

SeverityMeaningAction
ErrorTag violates a MUST requirement in the specFix before serving. Likely to cause render failure.
WarningTag violates a SHOULD requirement or uses deprecated syntaxFix soon. May cause issues on some players.
InfoAdvisory. Tag is valid but could be improved.Optional improvement

Language-specific validator guides

If you are choosing a production library rather than doing a one-off browser check, start with the runtime-specific guide.

Next steps

Check a tag while you read.

Open a related example, then replace it with your own tag.