Skip to main content

Get related products

GET 

/search/relations/result

Returns related products for a single product based on identifier.

At least one of includeRelations or includeTags must be provided. Omitting both returns a 400 Bad Request error. You may send both.

Recommended limits

  • includeRelations: up to 30 per request
  • includeTags: up to 30 per request

Larger requests may exceed URL length limits and fail.

includeRelations: define which relations to resolve by sending a list of relation ids paired with a limit.

Example: [{"id":6548, "limit":5}, {"id":9878, "limit":5}]

Relation ids can be copied from the three-dot menu next to each relation in the Data Platform. The limit determines how many related products are returned per requested relation.

includeTags: define which relations to resolve by sending a list of tag objects paired with a limitPerRelation.

Example: [{"tag":"Compatible", "limitPerRelation":4}]

Tags correspond with the relation type found in the Data Platform. limitPerRelation specifies how many products can be returned for each relation with a matching tag.

Please refer to this guide for details and examples.

matchType

Each relation in the response includes a matchType field that indicates which direction the relation matched:

  • FIRST_WAY — the requested product was found on the source side and related products on the target side. This is the normal case and the only value returned for one-way relations.
  • SECOND_WAY — the relation matched in the reverse direction. This only occurs for two-way relations: when the forward direction finds no results, the system retries with source and target swapped. A match in that direction is tagged SECOND_WAY.

This field is always present; it defaults to FIRST_WAY when unset.

Empty searchResult

When a product has no related products for a given tag, the normal response still includes the tag and its relation object — only searchResult is empty ([]). The relations array is not empty; it contains the relation object with matchType and other fields set normally.

The tag and relation are omitted entirely only in edge cases: when the relation's target side contains no products at all, or the relation is misconfigured. If all relations under a tag fall into this category, that tag will not appear in tags.

Request

Responses

OK

{
"tags": [
{
"tag": "Compatible",
"relations": [
{
"name": "Matching Accessories",
"id": 4728,
"matchType": "FIRST_WAY",
"searchResult": [
{
"identifier": "PRD-9876-BLU40",
"groupId": "9876",
"sxId": 240538699,
"name": "Laptop Case 9876 Blue",
"brand": "BrandX",
"category": "Cases",
"image": "www.myshop.com/product/9876-blu40/img.jpg",
"link": "www.myshop.com/product/9876-blu40",
"relevance": 1000000
}
]
}
]
}
]
}