> ## Documentation Index
> Fetch the complete documentation index at: https://docs.retailed.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Products

> Get products from our database

Retailed provides an extremely granular querying language through all APIs. Each API takes the same syntax and fully supports all options.

> [!TIP]
>
> If you have any questions or need help with the API, please reach out our support team on Slack, Discord or Email.

### Header

**x-api-key** `string` *required*

Parameter defines the Retailed private key to use.

### Operators

| Operator | Description |
| - | - |
| equals | The value must be exactly equal. |
| not\_equals | The query will return all documents where the value is not equal. |
| greater\_than | For numeric or date-based fields. |
| greater\_than\_equal | For numeric or date-based fields. |
| less\_than | For numeric or date-based fields. |
| less\_than\_equal | For numeric or date-based fields. |
| like | Case-insensitive string must be present. If string of words, all words must be present, in any order. |
| contains | Must contain the value entered, case-insensitive. |
| in | The value must be found within the provided comma-delimited list of values. |
| not\_in | The value must NOT be within the provided comma-delimited list of values. |
| all | The value must contain all values provided in the comma-delimited list. |
| exists | Only return documents where the value either exists (true) or does not exist (false). |

### Query Parameters

**where\[or]\[0]\[and]\[0]\[name]\[equals]** `string`

An example of a query parameter for the name field.

**where\[or]\[0]\[and]\[0]\[sku]\[equals]** `string`

An example of a query parameter for the sku field.

**page** `number`

The page number to return. Defaults to 1. You can paginate with the `totalPages` in the response.

> [!NOTE]
>
> I want to get all products with a retail price of 85 or 90 and with a description.

```markdown Example Query theme={null}
GET https://app.retailed.io/api/v1/db/products?where[or][0][and][0][price][in]=85&where[or][1][and][0][price][in]=90&where[or][2][and][0][description][exists]=true&sort=-description
```

### Sort

Retailed find queries support a sort parameter through all APIs. Pass the name of a top-level field to sort by that field in ascending order.
Prefix the name of the field with a minus symbol ("-") to sort in descending order.
Because sorting is handled by the database, the field you wish to sort on must be stored in the database to work; not a virtual field.

`https://app.retailed.io/api/v1/db/products?sort=-createdAt`

### Response

> [!NOTE]
>
> 1 request returns 10 products by default.

**products** `Products Object`

**docs**

**id** `string`

The unique identifier for the product

**productId** `string`

The unique identifier for the product from the source : `websitesource-countrycode-productid` (e.g `stockx-us-air-jordan-alpha-1-university-blue`).

**name** `string`

The name of the source website : `stockx-us`, `zalando-fr`, etc.

**country** `string`

The country of the source website : `us`, `fr`, etc.

**currency** `string`

The currency of the source website : `usd`, `eur`, etc.

**currencySymbol** `string`

The currency symbol of the source website : `$`, `€`, etc.

**url** `string`

The url of the product on the source website

**domain** `string`

The domain of the source website : `stockx.com`, `zalando.fr`, etc.

**urlSlug** `string`

The url slug of the product on the source website

**errorCrawling** `boolean`

Whether the product has an error while crawling

**isNotFound** `boolean`

Whether the product is not found on the source website

**createdAt** `string`

The date of creation of the product in our system

**updatedAt** `string`

The date of last update of the product in our system

**description** `string`

The description of the product

**images** `array`

The images of the product with the thumbnail and the original size

**lastCrawledAt** `string`

The date of last crawl of the product

**price** `number`

The retail price of the product

**urlId** `string`

The unique identifier for the product url

**variants** `array`

Related variants of the product

**sizes** `array`

The sizes of the product

**sku** `string`

The sku of the product

**title** `string`

The title of the product

```bash Request slug theme={null}
curl --location --request GET 'https://app.retailed.io/api/v1/db/products?where[or][0][and][0][productId][equals]=stockx-us-air-jordan-alpha-1-university-blue' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <token>' \
```

```bash Request sku theme={null}
curl --location --request GET 'https://app.retailed.io/api/v1/db/products?where[or][0][and][0][sku][equals]=392813-103' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <token>' \
```

```bash Request upc or ean (relation) theme={null}
curl --location --request GET 'https://app.retailed.io/api/v1/db/products?where[or][0][and][0][variants.id][equals]=884500475069' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <token>' \
```

```json Example Response theme={null}
{
    "docs": [
        {
            "id": "65495f475493f73e4ea472ea",
            "productId": "stockx-us-air-jordan-alpha-1-university-blue",
            "name": "stockx-us",
            "country": "us",
            "currency": "usd",
            "currencySymbol": "$",
            "url": "https://stockx.com/air-jordan-alpha-1-university-blue",
            "domain": "stockx.com",
            "urlSlug": "air-jordan-alpha-1-university-blue",
            "errorCrawling": false,
            "isNotFound": false,
            "createdAt": "2023-11-06T21:48:55.897Z",
            "updatedAt": "2024-01-18T09:40:13.428Z",
            "lastCrawledAt": "2024-01-18T09:40:11.403Z",
            "price": 125,
            "urlId": "69b1ca16-a37f-4643-99b4-55d037e56ec9",
            "variants": [
                {
                    "id": "884500475069",
                    "products": [
                        "65495f475493f73e4ea472ea"
                    ],
                    "barcodeFormats": "UPC-A 884500475069",
                    "model": "Jordan Alpha 1",
                    "sku": "392813-103",
                    "title": "Jordan Alpha 1 University Blue",
                    "category": "sneakers",
                    "brand": "Jordan",
                    "color": "White/Black-University Blue",
                    "size": "9",
                    "releaseDate": "2010-03-13T00:00:00.000Z",
                    "lastCrawledAt": "2024-01-18T09:40:11.555Z",
                    "errorCrawling": false,
                    "createdAt": "2023-11-17T00:46:04.652Z",
                    "updatedAt": "2024-01-18T09:40:11.660Z",
                    "description": null,
                    "reviews": []
                },
                {
                    "id": "884500475106",
                    "products": [
                        "65495f475493f73e4ea472ea"
                    ],
                    "barcodeFormats": "UPC-A 884500475106",
                    "model": "Jordan Alpha 1",
                    "sku": "392813-103",
                    "title": "Jordan Alpha 1 University Blue",
                    "category": "sneakers",
                    "brand": "Jordan",
                    "color": "White/Black-University Blue",
                    "size": "11",
                    "releaseDate": "2010-03-13T00:00:00.000Z",
                    "lastCrawledAt": "2024-01-18T09:40:12.077Z",
                    "errorCrawling": false,
                    "createdAt": "2023-11-17T00:46:04.986Z",
                    "updatedAt": "2024-01-18T09:40:12.168Z",
                    "description": null,
                    "reviews": []
                }
            ],
            "description": null,
            "images": [
                {
                    "id": "65a8f1fd47cea783f4fd15cb",
                    "productIdAlpha": "stockx-us-air-jordan-alpha-1-university-blue",
                    "prefix": "media",
                    "filename": "65495f475493f73e4ea472ea.jpg",
                    "mimeType": "image/jpeg",
                    "filesize": 93448,
                    "width": 1400,
                    "height": 1000,
                    "sizes": {
                        "thumbnail": {
                            "width": 480,
                            "height": 320,
                            "mimeType": "image/webp",
                            "filesize": 14840,
                            "filename": "65495f475493f73e4ea472ea-480x320.webp",
                            "url": "https://cdn.retailed.app/media/65495f475493f73e4ea472ea-480x320.webp"
                        }
                    },
                    "createdAt": "2024-01-18T09:40:13.281Z",
                    "updatedAt": "2024-01-18T09:40:13.281Z",
                    "url": "https://cdn.retailed.app/media/65495f475493f73e4ea472ea.jpg"
                }
            ],
            "sizes": [
                "7",
                "7.5",
                "8",
                "8.5",
                "9",
                "9.5",
                "10",
                "10.5",
                "11",
                "11.5",
                "12",
                "12.5",
                "13",
                "14",
                "15",
                "16",
                "17",
                "18"
            ],
            "sku": "392813-103",
            "title": "Jordan Alpha 1 University Blue"
        }
    ],
    "totalDocs": 1,
    "limit": 10,
    "totalPages": 1,
    "page": 1,
    "pagingCounter": 1,
    "hasPrevPage": false,
    "hasNextPage": false,
    "prevPage": null,
    "nextPage": null
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.