Try it

JSON

Sortyra team · · 2 min read

JSON (JavaScript Object Notation) is a text format for writing data as "name: value" pairs. People and computers can both read it, and it is used mainly when apps talk to each other through an API. Some suppliers also send their product list in it, much like XML or CSV.

What is JSON

JSON is like a filled-in form: every field has a name and a value. The form can also contain smaller forms (an address, for example) and lists (several images, for example).

The basic building blocks:

  • Object in curly brackets { } – a group of "name": value pairs.
  • Array in square brackets [ ] – several values in a row.
  • Values – text in quotation marks, a number, true/false or null (empty).

A variant is JSON Lines (also NDJSON): every line of the file is one separate object, that is, one product. Such a file can be read line by line even with hundreds of thousands of products.

What it looks like in a feed

[
  {
    "id": "STAN-3P",
    "title": "Trailo Dome 3 tent for 3 people",
    "price": 149.90,
    "currency": "EUR",
    "ean": "8581234567894",
    "in_stock": true,
    "images": [
      "https://www.sortyra.com/img/dome-3.jpg",
      "https://www.sortyra.com/img/dome-3-vnutro.jpg"
    ]
  }
]

A list with one product: ID, name, price, EAN, availability and two images. Every supplier chooses its own field names.

What it is used for

  • APIs – online shops, marketplaces and advertising platforms almost always exchange data in JSON.
  • Supplier feeds – some wholesalers offer a product export in JSON instead of XML.
  • Webhooks and settings – notifications between systems and backups of settings.

Price comparison sites such as Heureka or Zboží and Google Merchant Center usually expect XML or a text file for feeds, not JSON.

What to watch out for

  • Commas and brackets – a missing comma, or an extra comma after the last item, makes the whole file unreadable.
  • Quotation marks – names and texts must be in straight double quotation marks ", not typographic ones.
  • Number or text – an EAN written as a number can lose its leading zeros; it is safer to write it as text.
  • No fixed standard for products – two JSON feeds from two suppliers almost always use different field names.

How Sortyra helps

As a source, Sortyra reads JSON and JSON Lines in any structure and recognises the fields by name and by content. As an output you can choose the Custom JSON format. You can download your rules and upload them as a JSON file, and the REST API and webhooks both communicate in JSON.

Frequently asked questions

Is JSON or XML better?

Neither is better in general. What matters is what the channel accepts – comparison sites mostly want XML, while APIs work with JSON.

How do I open a JSON file?

In any text editor. A browser or a code editor that highlights the structure will show it more clearly.

What is JSON Lines?

A file with one separate JSON object on every line. It suits large product lists.

Try it on your own feed