YML and CSV formats

YML format

The YML (Yandex Market Language) standard was developed by Yandex and is based on the XML standard.

Requirements for YML files

  1. The YML standard does not support nonprintable characters with ASCII codes 0 through 31 (except for characters with codes 9, 10, and 13: tab, new line, and carriage return).

  2. The " & > < and ' characters need to be replaced with their equivalent codes:

    Symbol in text

    Code for YML file

    "
    &
    >
    <
    '
    "
    &
    >
    <
    '
    Note. You can use the characters "&><'in the CDATA block of an offer description.
  3. Acceptable YML file encodings: UTF-8, windows-1251.

YML file structure

<?xml version="1.0" encoding="UTF-8"?>
<yml_catalog date="2017-02-05 17:22">
  <shop>
    ...
    <offers>
      ...     
    </offers>
    <gifts>
      ...
    </gifts>
    <promos>
      ...
    </promos>
  </shop>
</yml_catalog>
Element Description
xml header Standard XML header. The header should start from the first line with the null character.
yml_catalog Any XML document may contain only one root element. The YML format uses the <yml_catalog> element as the root. The date attribute of the <yml_catalog> element must match the date and time when the YML file was generated on the store side. The date should be in the YYYY-MM-DD hh:mm format.
shop

This element contains a description of the store (shop), its offers, and promos and gifts:

View full YML example
<?xml version="1.0" encoding="UTF-8"?>
<yml_catalog date="2017-02-05 17:22">
    <shop>
    <name>BestSeller</name>
    <company>Tne Best inc.</company>
    <url>http://best.seller.ru</url>
    <currencies>
      <currency id="RUR" rate="1"/>
      <currency id="USD" rate="60"/>
    </currencies>
    <categories>
      <category id="1">Бытовая техника</category>
      <category id="10" parentId="1">Мелкая техника для кухни</category>
      <category id="101" parentId="10">Сэндвичницы и приборы для выпечки</category>
      <category id="102" parentId="10">Мороженицы</category>
    </categories>
    <delivery-options>
      <option cost="300" days="0" order-before="12"/>
    </delivery-options>
    <offers>
      <offer id="12346" bid="80">
        <name>Вафельница First FA-5300</name>
        <vendor>First</vendor>
        <vendorCode>A1234567B</vendorCode>
        <url>http://best.seller.ru/product_page.asp?pid=12348</url>
        <price>1490</price>
        <oldprice>1620</oldprice>
        <currencyId>RUR</currencyId>
        <categoryId>101</categoryId>
        <picture>http://best.seller.ru/img/large_12348.jpg</picture>
        <store>false</store>
        <pickup>true</pickup>
        <delivery>true</delivery>
        <delivery-options>
          <option cost="300" days="0" order-before="12"/>
        </delivery-options>
        <description>
        <![CDATA[
          <p>Отличный подарок для любителей венских вафель.</p>
        ]]>
        </description>
        <sales_notes>Необходима предоплата.</sales_notes>
        <manufacturer_warranty>true</manufacturer_warranty>
        <country_of_origin>Россия</country_of_origin>
        <barcode>0156789012</barcode>
      </offer>
      <offer id="9012" type="vendor.model" bid="80">
        <typePrefix>Мороженица</typePrefix>
        <vendor>Brand</vendor>
        <model>3811</model>
        <url>http://best.seller.ru/product_page.asp?pid=12345</url>
        <price>8990</price>
        <oldprice>9900</oldprice>
        <currencyId>RUR</currencyId>
        <categoryId>102</categoryId>
        <picture>http://best.seller.ru/img/model_12345.jpg</picture>
        <store>false</store>
        <pickup>false</pickup>
        <delivery>true</delivery>
        <delivery-options>
          <option cost="300" days="1" order-before="18"/>
        </delivery-options>
        <description>
        <![CDATA[
          <h3>Мороженица Brand 3811</h3>
          <p>Это прибор, который придётся по вкусу всем любителям десертов и сладостей, ведь с его помощью вы сможете делать вкусное домашнее мороженое из натуральных ингредиентов.</p>
        ]]>
        </description>
        <param name="Цвет">белый</param>
        <sales_notes>Необходима предоплата.</sales_notes>
        <manufacturer_warranty>true</manufacturer_warranty>
        <country_of_origin>Китай</country_of_origin>
        <barcode>0123456789379</barcode>
      </offer>
    </offers>
  </shop>
</yml_catalog>

Plain text (CSV) format

A plain text file with separators is a convenient format for generating a price list from databases or spreadsheet editors (such as Excel, OpenOffice, or Google Docs).

Requirements for price lists that are submitted in plain text format

  1. Each line in the file should correspond to a single row in the spreadsheet.

  2. The fields are separated by either a comma or semicolon (CSV), or a tab (TSV).

  3. Each line in the file should contain a description of a single product offer.

  4. The first line must contain field names.

  5. The file must be UTF-8 encoded.

  6. Tabs and line breaks cannot be used inside fields.

  7. The file should not contain empty columns.

  8. There is no set order that columns (fields) must follow, but they must be kept in the same order within a single file.