<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.whatwg.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Xjamundx</id>
	<title>WHATWG Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.whatwg.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Xjamundx"/>
	<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/wiki/Special:Contributions/Xjamundx"/>
	<updated>2026-05-01T00:59:11Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.whatwg.org/index.php?title=Validator.nu_Web_Service_Interface&amp;diff=8547</id>
		<title>Validator.nu Web Service Interface</title>
		<link rel="alternate" type="text/html" href="https://wiki.whatwg.org/index.php?title=Validator.nu_Web_Service_Interface&amp;diff=8547"/>
		<updated>2012-10-16T23:27:18Z</updated>

		<summary type="html">&lt;p&gt;Xjamundx: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Validator.nu can be called as a Web service. Input and output modes can be chosen completely orthogonally. Responses and requests can be optionally compressed (independently of each other).&lt;br /&gt;
&lt;br /&gt;
(Please use the Web service API reasonably. See the [http://about.validator.nu/#tos Terms of Service].)&lt;br /&gt;
&lt;br /&gt;
==Input Modes==&lt;br /&gt;
&lt;br /&gt;
For most Web service use cases, you should probably POST the document as the HTTP entity body.&lt;br /&gt;
&lt;br /&gt;
===Implemented===&lt;br /&gt;
&lt;br /&gt;
* Document [[Validator.nu GET Input|URL as a GET parameter]]; the service retrieves the document by URL over HTTP or HTTPS.&lt;br /&gt;
* Document [[Validator.nu POST Body Input|POSTed as the HTTP entity body]]; parameters in query string as with GET.&lt;br /&gt;
* Document [[Validator.nu Textarea Input|POSTed as a &amp;lt;code&amp;gt;textarea&amp;lt;/code&amp;gt; value]].&lt;br /&gt;
* Document [[Validator.nu Form Upload Input|POSTed as a form-based file upload]].&lt;br /&gt;
&lt;br /&gt;
===Not Implemented===&lt;br /&gt;
&lt;br /&gt;
* Document in a &amp;lt;CODE&amp;gt;data:&amp;lt;/CODE&amp;gt; URI as a GET parameter.&lt;br /&gt;
* &amp;lt;code&amp;gt;application/x-www-form-urlencoded&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Output Modes==&lt;br /&gt;
&lt;br /&gt;
When using Validator.nu as a Web service back end, the [[Validator.nu XML Output|XML]] and [[Validator.nu JSON Output|JSON]] output formats are recommended for forward compatibility. The available JSON tooling probably makes consuming JSON easier. The XML format contains XHTML elaborations that are not available in JSON. Both formats are streaming, but streaming XML parsers are more readily available. XML cannot represent some input strings faithfully.&lt;br /&gt;
&lt;br /&gt;
===Implemented===&lt;br /&gt;
&lt;br /&gt;
* HTML with microformat-style &amp;lt;CODE&amp;gt;class&amp;lt;/CODE&amp;gt; annotations (default output; should not be assumed to be forward-compatibly stable).&lt;br /&gt;
* XHTML with microformat-style &amp;lt;CODE&amp;gt;class&amp;lt;/CODE&amp;gt; annotations (append &amp;lt;code&amp;gt;&amp;amp;out=xhtml&amp;lt;/code&amp;gt; to URL; should not be assumed to be forward-compatibly stable).&lt;br /&gt;
* [[Validator.nu XML Output|XML]] (append &amp;lt;code&amp;gt;&amp;amp;out=xml&amp;lt;/code&amp;gt; to URL).&lt;br /&gt;
* [[Validator.nu JSON Output|JSON]] (append &amp;lt;code&amp;gt;&amp;amp;out=json&amp;lt;/code&amp;gt; to URL).&lt;br /&gt;
* [[Validator.nu GNU Output|GNU error format]] (append &amp;lt;code&amp;gt;&amp;amp;out=gnu&amp;lt;/code&amp;gt; to URL).&lt;br /&gt;
* Human-readably plain text (append &amp;lt;code&amp;gt;&amp;amp;out=text&amp;lt;/code&amp;gt; to URL; should not be assumed to be forward-compatibly stable for machine parsing—use the GNU format for that).&lt;br /&gt;
&lt;br /&gt;
===Not Implemented===&lt;br /&gt;
&lt;br /&gt;
* Relaxed-compatible (lacks a spec)&lt;br /&gt;
* Unicorn-compatible (hoping that Unicorn changes instead)&lt;br /&gt;
* W3C Validator-compatible SOAP (legacy)&lt;br /&gt;
* EARL (not implemented; domain modeling mismatch)&lt;br /&gt;
&lt;br /&gt;
==Compression==&lt;br /&gt;
&lt;br /&gt;
Validator.nu supports compression in order to save bandwidth.&lt;br /&gt;
&lt;br /&gt;
===Request Compression===&lt;br /&gt;
&lt;br /&gt;
Validator.nu supports HTTP request compression. To use it, compress the request entity body using gzip and specify &amp;lt;code&amp;gt;Content-Encoding: gzip&amp;lt;/code&amp;gt; as a &#039;&#039;request&#039;&#039; header.&lt;br /&gt;
&lt;br /&gt;
===Response Compression===&lt;br /&gt;
&lt;br /&gt;
Validator.nu supports HTTP response compression. Please use it. Response compression is orthogonal to the input methods and output formats.&lt;br /&gt;
&lt;br /&gt;
The standard HTTP gzip mechanism is used. To indicated that you prepared to handle gzipped responses, include the &amp;lt;code&amp;gt;Accept-Encoding: gzip&amp;lt;/code&amp;gt; request header. When the header is present, Validator.nu will gzip compress the response. You should also be prepared to receive an uncompressed, though, since in the future it may make sense to turn off compression under heavy CPU load.&lt;br /&gt;
&lt;br /&gt;
==Sample Code==&lt;br /&gt;
&lt;br /&gt;
There a [http://about.validator.nu/html5check.py sample Python program] that shows how to deal with compression and redirects. (It may not be exemplary Python, though.)&lt;br /&gt;
&lt;br /&gt;
==CORS Example==&lt;br /&gt;
&lt;br /&gt;
You can also hit the API using [https://developer.mozilla.org/en-US/docs/HTTP_access_control CORS] over AJAX. [https://gist.github.com/gists/3902535 Basic example using jQuery].&lt;br /&gt;
&lt;br /&gt;
==Sample Messages==&lt;br /&gt;
&lt;br /&gt;
There are [http://hsivonen.iki.fi/test/moz/messages-types/ documents for provoking different message types].&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|-&lt;br /&gt;
! No message&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Fno-message.html HTML]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Fno-message.html&amp;amp;out=xhtml XHTML]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Fno-message.html&amp;amp;out=xml XML]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Fno-message.html&amp;amp;out=json JSON]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Fno-message.html&amp;amp;out=gnu GNU]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Fno-message.html&amp;amp;out=text Text]&lt;br /&gt;
|-&lt;br /&gt;
! Info&lt;br /&gt;
| [http://validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Finfo.svg HTML]&lt;br /&gt;
| [http://validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Finfo.svg&amp;amp;out=xhtml XHTML]&lt;br /&gt;
| [http://validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Finfo.svg&amp;amp;out=xml XML]&lt;br /&gt;
| [http://validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Finfo.svg&amp;amp;out=json JSON]&lt;br /&gt;
| [http://validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Finfo.svg&amp;amp;out=gnu GNU]&lt;br /&gt;
| [http://validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Finfo.svg&amp;amp;out=text Text]&lt;br /&gt;
|-&lt;br /&gt;
! Warning&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Fwarning.html HTML]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Fwarning.html&amp;amp;out=xhtml XHTML]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Fwarning.html&amp;amp;out=xml XML]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Fwarning.html&amp;amp;out=json JSON]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Fwarning.html&amp;amp;out=gnu GNU]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Fwarning.html&amp;amp;out=text Text]&lt;br /&gt;
|-&lt;br /&gt;
! Error (precise location)&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Fprecise-error.html HTML]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Fprecise-error.html&amp;amp;out=xhtml XHTML]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Fprecise-error.html&amp;amp;out=xml XML]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Fprecise-error.html&amp;amp;out=json JSON]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Fprecise-error.html&amp;amp;out=gnu GNU]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Fprecise-error.html&amp;amp;out=text Text]&lt;br /&gt;
|-&lt;br /&gt;
! Error (range location)&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Frange-error.html HTML]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Frange-error.html&amp;amp;out=xhtml XHTML]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Frange-error.html&amp;amp;out=xml XML]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Frange-error.html&amp;amp;out=json JSON]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Frange-error.html&amp;amp;out=gnu GNU]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Frange-error.html&amp;amp;out=text Text]&lt;br /&gt;
|-&lt;br /&gt;
! Fatal&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Ffatal.xhtml HTML]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Ffatal.xhtml&amp;amp;out=xhtml XHTML]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Ffatal.xhtml&amp;amp;out=xml XML]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Ffatal.xhtml&amp;amp;out=json JSON]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Ffatal.xhtml&amp;amp;out=gnu GNU]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2Ffatal.xhtml&amp;amp;out=text Text]&lt;br /&gt;
|-&lt;br /&gt;
! IO&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2F404.html HTML]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2F404.html&amp;amp;out=xhtml XHTML]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2F404.html&amp;amp;out=xml XML]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2F404.html&amp;amp;out=json JSON]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2F404.html&amp;amp;out=gnu GNU]&lt;br /&gt;
| [http://html5.validator.nu/?doc=http%3A%2F%2Fhsivonen.iki.fi%2Ftest%2Fmoz%2Fmessages-types%2F404.html&amp;amp;out=text Text]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Validator.nu Documentation]]&lt;/div&gt;</summary>
		<author><name>Xjamundx</name></author>
	</entry>
</feed>