summaryrefslogtreecommitdiffstats
path: root/htdocs/htmlchecker_api.html
blob: 9abe147d8eb4dc6c446529f26480700aa86f54e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
    <p>
      For programmatic checking of modern HTML documents, you probably want
      to instead use the API provided by the
      <a href="https://validator.w3.org/nu/">W3C HTML Checker</a>. To do
      that, call
      <a href="https://validator.w3.org/nu/">https://validator.w3.org/nu/</a>
      or the URL for another instance of the W3C HTML Checker, and consult
      the following documentation:
    </p>

    <img src="/images/HTML5_Badge_128.png" alt="HTML5" class="html5_logo_128">
    <ul>
      <li><a href="https://github.com/validator/validator/wiki/Service:-Input:-GET">W3C HTML Checker GET interface</a></li>
      <li><a href="https://github.com/validator/validator/wiki/Service:-Input:-POST-body">W3C HTML Checker POST interface</a></li>
      <li><a href="https://github.com/validator/validator/wiki/Service:-Common-parameters">W3C HTML Checker parameters</a></li>
      <li><a href="https://github.com/validator/validator/wiki/Output%3A-JSON">W3C HTML Checker out=json format</a></li>
      <li><a href="https://github.com/validator/validator/wiki/Output:-XML">W3C HTML Checker out=xml format</a></li>
      <li><a href="https://github.com/validator/validator/wiki/Output:-GNU">W3C HTML Checker out=gnu format</a></li>
    </ul>
    <p>
      If for some reason rather than using the W3C HTML Checker API, you
      want to use the W3C Markup Validator API, the simplest way to
      do that is just to call <code>https://validator.w3.org/check?</code>
      with a query string that includes the "<code>uri</code>" parameter
      and the URL for the document to check, and with the
      "<code>output=json</code>" parameter appended; for example:
      <a href="https://validator.w3.org/check?uri=https://example.com/&amp;output=json">https://validator.w3.org/check?uri=https://example.com/&amp;output=json</a>.
      The W3C Markup Validator will return the results as JSON, in
      <a href="https://github.com/validator/validator/wiki/Output:-JSON">the same JSON format used by the W3C HTML Checker</a>.
      You can specify other W3C Markup Validator options as additional query
      parameters. The names of the query parameters are listed in the section
      <a href="/docs/users.html#Options">Controlling the behavior of the W3C Markup Validator</a>,
      in parentheses after the name of each option described.
      All values for query parameters should be encoded in UTF-8 (before
      percent-encoding them).
      Separate the query parameters with either "<code>;</code>"
      (semicolon) characters or with "<code>&amp;</code>" (ampersand)
      characters.
    </p>