Try it

Feed types: XML, CSV, TSV, JSON, Google Sheets and API

Sortyra team · · 9 min read

A product feed can take several forms. The most common is XML, which writes data inside tags, and CSV or TSV, which are plain tables. JSON is used mainly by modern systems and APIs. The content is the same in all of them – a list of products with their data – only the way it is written differs.

One content, different wrappers

A product feed is a list of products with their data (if you are not sure what a feed is, start with the article What is a product feed). The same list can be written down in different ways – just as the same recipe can be in a cookbook, on a scrap of paper or in a spreadsheet on your computer. The recipe stays the same; only the way it is written changes.

This way of writing is called the feed format. The format is chosen by whoever reads the feed: a comparison site, an advertising system or an online shop states in its specification exactly which format and which field names it accepts. You adapt to that.

In the following sections we show the same product – a sleeping bag – in each common format.

XML – the most widespread feed format

XML (eXtensible Markup Language) puts each piece of data between two tags: an opening <NAME> and a closing </NAME>. Tags can be nested inside one another, so XML also copes well with more complex things – several images, attributes, variants or delivery options.

<SHOPITEM>
  <ITEM_ID>SPAC-118</ITEM_ID>
  <PRODUCTNAME>Horalka Mumia 800 sleeping bag, down to -5 °C</PRODUCTNAME>
  <PRICE_VAT>89.00</PRICE_VAT>
  <EAN>8580004987658</EAN>
  <PARAM>
    <PARAM_NAME>Colour</PARAM_NAME>
    <VAL>blue</VAL>
  </PARAM>
</SHOPITEM>

Where you will come across it: feeds for Heureka, Zboží and most price comparison sites, Google Merchant Center (in the RSS variant with g: tags), exports from e-commerce platforms and wholesalers' feeds.

Advantages: it handles nested data (for example, several attributes for one product), has a clear structure and can be validated to check it is written correctly.

What to watch out for:

  • Every opened tag must be closed. A single mistake can break the whole file.
  • The characters & and < in text must be escaped (for example as &amp;) or placed inside a <![CDATA[ … ]]> block, which says "this is plain text".
  • Case matters: <EAN> and <ean> are two different tags to a computer.

CSV – a plain table

CSV (Comma-Separated Values) is a table saved as text. The first row contains the column names, each following row is one product, and the values are separated by a delimiter – a comma, a semicolon or another character.

id;name;price;ean;colour
SPAC-118;"Horalka Mumia 800 sleeping bag, down to -5 °C";89.00;8580004987658;blue

Where you will come across it: wholesalers' feeds, imports into online shops, price lists, exports from accounting and stock management systems. You can open a CSV in Excel or any other spreadsheet program.

Advantages: it is simple, easy to read and easy to edit in a spreadsheet.

What to watch out for:

  • The delimiter. In many European countries the semicolon is common, in English-speaking ones the comma. If a program uses the wrong delimiter, everything ends up in a single column.
  • Quotation marks. If a value contains the delimiter (for example, a comma in the title), it must be in quotation marks – like the sleeping bag's title in the example.
  • Decimal comma and decimal point. A price of 89,00 and 89.00 doesn't mean the same thing to every system.
  • Excel changes data. When you open the file in Excel, a 13-digit EAN can turn into 8.58E+12 or leading zeros can disappear. If you then save the file in Excel, the damaged values are saved permanently.
  • Several values in one cell (for example, several images) must be separated by another character that both sides have agreed on.

TSV – a tab-separated table

TSV (Tab-Separated Values) is the same as CSV, except that the values are separated by a tab (an invisible character you insert with the Tab key). Because tabs almost never appear in titles and descriptions, most of the problems with quotation marks disappear.

Google Merchant Center and the catalogue for Facebook and Instagram both accept tab-separated text files. The file can have the extension .tsv or .txt.

JSON – the format of modern systems

JSON (JavaScript Object Notation) writes data as "name: value" pairs inside curly brackets. It is shorter than XML and is used mainly by modern applications and APIs.

{
  "id": "SPAC-118",
  "name": "Horalka Mumia 800 sleeping bag, down to -5 °C",
  "price": 89.00,
  "ean": "8580004987658",
  "attributes": { "colour": "blue" }
}

One variant is JSON Lines – each line of the file is a separate product in JSON. Such a file is easy to process in chunks, which is why it is used for large catalogues.

E-commerce platforms return JSON too. For example, the product list of a Shopify store has variants nested inside each product – every size or colour has its own code, price, stock and EAN.

What to watch out for: a missing or extra comma breaks the whole file. EANs and codes belong in quotation marks as text, otherwise they can lose their leading zeros.

Excel (XLSX)

Some suppliers send their range as an Excel file. It is convenient for people but less so for automatic processing: it can have several sheets, merged cells or formulas. For a regular feed, it is better to ask the supplier for a CSV or XML file at a permanent URL.

Google Sheets – a spreadsheet in the cloud

Google Sheets is an online spreadsheet. It is handy when you only have a few dozen products or when several people fill in the data at the same time. Google Merchant Center can read the spreadsheet directly; other systems usually read it as a CSV – you publish the sheet via File → Share → Publish to web in CSV format and get a URL from which it can be downloaded.

What to watch out for: anyone with edit access can accidentally overwrite a column or delete a row, and the mistake is passed on immediately. With a larger product range, a spreadsheet is prone to typos.

API – data on request, not a file

An API (application programming interface) is not a file but a "hatch" through which one system requests data from another. Instead of downloading the whole feed, a program asks, for example, "give me the products changed in the last hour" and gets an answer – usually in JSON.

APIs are used mainly by marketplaces, large advertising platforms and business systems. The advantage is speed and the ability to send only the changes; the disadvantage is that connecting usually requires programming or a ready-made tool.

Format comparison

FormatWhat it looks likeWhere it is used mostMain risk
XMLtags in angle bracketscomparison sites, Google, online shopsan unclosed tag, the & character
CSVa table, delimiter , or ;wholesalers, shop importswrong delimiter, Excel ruins the EAN
TSVa table, tab as delimiterGoogle, Facebook and Instagrama tab overwritten
JSONname: value pairsmodern systems, APIsa missing comma
XLSXan Excel filesmaller supplierssheets, formulas, merged cells
Google Sheetsan online spreadsheetsmall catalogues, manual managementdata overwritten by mistake
APIa response to a requestmarketplaces, business systemsrequires an integration

Character encoding: why accented letters get garbled

Besides its format, every text feed also has an encoding – an agreement on how letters are stored in a computer. Today the standard is UTF-8, which handles every language. Older systems in the Czech Republic and Slovakia also use windows-1250. If you read a file in one encoding as if it were another, "café" turns into something like "cafĂ©". In XML the encoding is stated in the first line (encoding="UTF-8"); for a CSV you have to know it or guess it.

How Sortyra helps with formats

Sortyra reads sources in XML, CSV, JSON (including JSON Lines), Excel (XLSX) and Google Sheets (a link to the shared sheet is enough – Sortyra does the CSV export itself) – from a permanent address (https://, ftp://, ftps:// or sftp://), also packed in ZIP or .gz and also with a username and password or a key in the header. It detects the format and encoding by itself and works out the meaning of every field by both name and content, so it doesn't matter that every supplier calls them something different – you confirm uncertain fields, prices, VAT, stock and links. It also recognises the product list of a Shopify or WooCommerce store in JSON and imports variants nested inside a product as separate products linked into one group. It then writes the outputs in the format the channel requires, or in your own custom XML or CSV. Sortyra reads what a single address returns: it doesn't read sources that can only be connected through other systems' APIs or that split the product list across several pages – in that case, use a complete export in one of the formats above. We explain why a tool is worth it in the article What is a feed manager.

Frequently asked questions

What is the difference between an XML and a CSV feed?

XML writes each piece of data into named tags and can handle nested data, such as several attributes per product. CSV is a simple table where a row is a product and a column is a piece of data – it is easier to read but copes less well with complex structures.

Which feed format is best?

The one required by the channel you are sending the feed to. For price comparison sites it is almost always XML; for Google and Facebook, XML or a tab-separated file.

Can I convert a CSV feed to XML?

Yes – the content is the same, only the way it is written changes. When converting, however, you need to map the columns correctly to the tags the target channel expects, and take care of the encoding and special characters.

Why did my EAN get ruined when I opened the CSV in Excel?

Excel treats long numbers as numeric values and shows them in scientific notation or removes leading zeros. When importing a CSV, set the EAN column as text, or open the file in a text editor.

Is an API better than a feed?

An API is faster and can send only the changes, but it requires an integration. For most online shops and comparison sites, a feed at a permanent URL is simpler and entirely sufficient.

Which encoding should a feed use?

UTF-8 is recommended: almost all channels accept it and it displays accented characters correctly in every language. The encoding should be stated in the header of the XML file.

Try it on your own feed