Validation for HTML

Request URL

Alert

The request URL contains the version number of the Structured Data Validator API. To find out the current value, see the section API versions.

https://validator-api.semweb.yandex.ru/v1.1/document_parser
  ? apikey=<API key>
  & [lang=<language for error messages>]
  & [pretty=<response output format>]
  & [id=<request ID>]
  & [only_errors=<type of response>]
apikey *

Value of the API key. You can get a free API key in the Developer's Dashboard.

lang

The language for messages about errors in structured data.

Acceptable values:

  • «ru» — Russian
  • «en» — English
  • «uk» — Ukrainian
  • «tr» — Turkish

If the lang parameter is not set, error messages are given in English (the default value is «en»).

pretty

How to output the response to the request.

Acceptable values:

  • «false» — The request result is output as continuous text.
  • «true» — The request result is output in a human-readable adapted format.

If the pretty parameter is not set, the request result is output without line breaks (the default value is «false»).

id

ID of the request. Used when performing asynchronous requests.

It may contain:

  • uppercase and lowercase Latin letters
  • numbers
  • symbols: - (dash) and _ (underline)
only_errors

The type of response returned: standard or errors only.

Acceptable values:

  • «false» — Returns a standard response (contains all the fields and values in the document being validated).

  • «true» — The response returns only information about fields containing errors.

    If errors were not found when validating the document, the server returns the code «204 No Content».

If the only_errors parameter was not set, the standard response is returned (the default value is «false»).

* Required.

Format of the request body

The request body contains the HTML code of the document to validate.

Example

Request to validate a document by its HTML code.

The HTTP request method is POST.

The response output format is human-readable (pretty=true).

The request ID is 1 (id=1).

The language for error messages is English (lang=en).

Request URL:

https://validator-api.semweb.yandex.ru/v1.1/document_parser?apikey=12345a12-3b4c-5123-d4ef-g51h23ij451&pretty=true&id=1&lang=en

Request body:

<div vocab="http://schema.org/" typeof="Movie">
<h1 property="name">Pirates of the Carribean: On Stranger Tides (2011)</h1>
<span property="description">Jack Sparrow and Barbossa embark on a quest to
 find the elusive fountain of youth, only to discover that Blackbeard and
 his daughter are after it too.</span>
Director:
 <div property="director"  typeof="Person">
<span property="name">Rob Marshall</span>
</div>
Writers:
 <div property="author"  typeof="Person">
<span property="name">Ted Elliott</span>
</div>
<div property="author"  typeof="Person">
<span property="name">Terry Rossio</span>
</div>
, and 7 more credits
Stars:
 <div property="actor"  typeof="Person">
<span property="name">Johnny Depp</span>,
 </div>
<div property="actor"  typeof="Person">
<span property="name">Penelope Cruz</span>,
</div>
<div property="actor"  typeof="Person">
<span property="name">Ian McShane</span>
</div>
<div property="aggregateRating"  typeof="AggregateRating">
  <span property="ratingValue">8</span>/<span property="bestRating">10</span> stars from
  <span property="ratingCount">200</span> users.
  Reviews: <span property="reviewCount">50</span>.
</div>
</div>

The section Response format shows an example of the response to the request.