# feed.json

How the shop's export is read and where each of its columns goes.

With this file, the mapping is exactly what it says: a column it does not name is reported as unmapped and never guessed, so a new column in the export cannot quietly change the shop.

## `format`

object

How the file is read, where recognizing it from its bytes would guess wrong.

How a file is read: its kind, and for text and spreadsheets the details a guess can get wrong. The import recognizes each from the bytes; a value here pins it.

- `kind` (string): The kinds of files the import reads. Any of them may arrive gzipped.
  
  - `jsonl`: OrbSearch's own catalog: one entity per line as JSON. It needs no mapping.
  
  - `csv`: Delimited text: CSV, TSV and TXT, Merchant Center's TSV included.
  
  - `xlsx`: An Excel workbook.
  
  - `xml`: A Merchant Center feed: RSS 2.0 or Atom with the `g:` namespace.
  
  - `json`: JSON records of a shape of their own, as an array or one object per line: nested objects are read as columns such as `dimensions.width`, arrays of plain values as lists.

- `delimiter` (string): Delimited text: the character between cells.
  
  - `,`: Delimited text: the character between cells.
  
  - `;`: Delimited text: the character between cells.
  
  - `	`: Delimited text: the character between cells.
  
  - `|`: Delimited text: the character between cells.

- `encoding` (string): Text: the character encoding.
  
  - `utf-8`
  
  - `utf-16le`
  
  - `utf-16be`
  
  - `windows-1252`: What Excel on Windows writes for German text; ISO 8859-1 reads the same.

- `decimal` (string): The decimal mark of numbers written as text, such as `,` in "1.099,00". Without it, each column's numbers tell.
  
  - `,`: The decimal mark of numbers written as text, such as `,` in "1.099,00". Without it, each column's numbers tell.
  
  - `.`: The decimal mark of numbers written as text, such as `,` in "1.099,00". Without it, each column's numbers tell.

- `sheet` (string): Spreadsheets: the sheet to read by its name. Default: the first.

- `header` (integer): Text and spreadsheets: the row holding the column names, counted from 1. Without it, the first row that looks like a header is taken, so title rows above it are skipped.

## `columns`

map of (string or object)

Each column by its name as the header writes it, and where its values go. A `*` in a name stands for the rest of a column's name, such as `Attribut_*` for `Attribut_Farbe`; a column named exactly wins over a pattern.

- `to` (string): Where a column's values go: a field such as title or price, attributes.\<code\>, attributes.\* (the code made from what the column name's \* matched), attributes (with name or pairs), signals.\<code\>, or ignore.

- `split` (string or array of strings): Lists: the text between the values of one cell, such as `,` in "bild1.jpg,bild2.jpg" or `|` in "Holz|Metall"; or several, any of which separates them, such as `["|", ";"]` in "Blau;Schwarz|Grau".

- `levels` (string): Categories: the text between the levels of one path, such as ` > ` in "Wohnen \> Sofas".

- `values` (map of strings): Availability: the shop's words for each state, such as `{ "sofort lieferbar": "in_stock" }`. One of `in_stock`, `out_of_stock`, `preorder` or `backorder`.

- `unit` (string): Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `mm`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `cm`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `m`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `in`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `ft`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `g`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `kg`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `lb`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `oz`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `ml`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `l`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `w`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `kw`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `wh`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `kwh`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `mah`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `v`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `lm`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `kelvin`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `celsius`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `hz`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `mb`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `gb`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `tb`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `day`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `month`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".
  
  - `year`: Attributes: the unit of plain numbers in the column, such as `cm` for a column "Breite" holding "218".

- `locale` (string): Texts, categories and localized attributes: the locale the column is written in. Default: the source locale, the first channel's first locale.

- `channel` (string): Offer fields: the channel the column's prices or stock belong to. Default: the first channel in channels.json.

- `name` (string): Attributes written as name and value in two columns: the column holding each value's attribute name, with the same `*` as this column's name, such as `"Attribute * name"` beside `"Attribute * value(s)"`.

- `pairs` (string): Attributes written as pairs in one cell, such as "Farbe: Rot | Breite: 218 cm": the text between the pairs.

- `assign` (string): With `pairs`: the text between an attribute's name and its value. Default: `:`.

## `uses`

object

What the export's product details are for, as a decision model judged them when the export arrived. The import follows it where the release leaves `categories.json` or `types.json` out, so it never freezes the shop: a detail it does not name is derived as if it were not there, and the next export's answer replaces it.

What each product detail is for: a filter, found by search, or neither. A detail is named in one list at most.

- `filter` (array of strings): Filters, the one shoppers need most first. Each is still a filter only where it passes the import's own test on a page, half the page's products and a choice of values.

- `search` (array of strings): Details whose words find their products when shoppers type them, beside title, brand and description.

- `none` (array of strings): Details shoppers neither filter by nor search, though the import would make them a filter.

## `$schema`

string

The JSON Schema an editor checks this file against; kept as written.

## Example

```json title="tests/fixtures/feeds/home/feed.json (trimmed)"
{
  "$schema": "../../../../contracts/schema/feed.json",
  "columns": {
    "Anzahl Bewertungen": "signals.rating_count",
    "Artikelnummer": "id",
    "Ausstattung": { "to": "attributes.features", "split": "|" },
    "Belastbarkeit (kg)": { "to": "attributes.max_load", "unit": "kg" },
    "Beschreibung": "description",
    "Beschreibung EN": { "to": "description", "locale": "en" },
    "Bestand": "stock",
    "Bewertung": "signals.rating"
  }
}
```

**Guide:** [The mapping file](/docs/importing#the-mapping-file)
