Skip to main content
RichRelevance

Product Trend Analytics API

Important: Only call parameters that you need. RichRelevance operates off a set of APIs that support many applications and clients concurrently. RichRelevance may update and enhance these APIs at any time. 

https://qa-gateway.richrelevance.com/mvt-api/datatrends/

Note: The URL requires the environment (gateway, staging-gateway or qa-gateway), version and parameter(s) to function properly. See below for more information on example URL requests.

Description: This API returns the Top 30 clicked, viewed and purchased products.

OAuth Signature

POST {baseUrl}/oauth2/token

Request an authorization bearer token by authenticating using your client credentials. The /oauth2/token endpoint must be called first to get a token that will give access to the other endpoints. Use the client id and secret sent to you by RichRelevance. The response from this API will contain your token, which will be valid until it is manually revoked. The response will be provided as JSON.

On all requests to the product and catalog APIs, pass an "Authorization: bearer MY_TOKEN" header. When the token expires you will need to get a new one using your client id and secret again.

Name Required or Optional Description
grant_type Required (string) The access token type. This is always client_credentials
client_id Required (string) The client's ID
client_secret Required (string)

A unique key to authorize a client app on behalf of the partner.

Example: clientSecret=wbhz6c41

Example

Good Response:

{
"token_type": "bearer",
"access_token": "AABBCCDD"
}

Error Response: 

{
"error_description": "Invalid client authentication",
"error": "invalid_client"
}

or

{
"error_description": "Invalid grant_type",
"error": "unsupported_grant_type"
}

Real Time Product Trends

ReportType: productTrends

Method: GET

Parameters:

Note:  All parameter names are case sensitive.

Name Required or Optional Input Description
timeWindow  Required number The time window in minutes. Valid input: 15, 30, 60, 240, 480, 720
trendType  Required string Valid input: clicks, views, purchases

Example:

curl -H 'Authorization: bearer tokenGeneratedFromTheAboveStep' "Accept: application/json" \
 -H "Content-Type: application/json" -X GET 'https://gateway.richrelevance.com/mvt-api/datatrends/?timeWindow=15&trendType=views'

Example Response


{
  "siteId": 338,
  "reportType": "Last30MinsTopProdPurchReport",
  "topProducts": [
    {
      "id": 2933934308,
      "externalId": "prod191580033",
      "name": "Anti-Aging Rapid Response Booster, Packette",
      "brand": "La Prairie",
      "imageId": "www.neimanmarcus.com/product_assets/C/2/3/J/T/NMC23JT_mh.jpg",
      "count": 19,
      "trend": 0,
      "trendList": [
        1,
        1,
        2,
        6,
        8,
        11,
        11,
        11,
        12,
        13
      ],
      "salePrice": 0,
      "discount": "0%"
    }
  ]
}

Response Parameters 

Name Example Description

id

2933934308


The internal product id.

externalID

prod191580033

The product catalog ID provided by the client


name

Anti-Aging Rapid Response Booster, Packette


The name of the product provided by the client
brand La Prairie The designated brand of the product, provided by the client
imageId wms.com/product_assets/C/2/3/J/T/NMC23JT_mh.jpg The image of the product provided with the product catalog

count


19

The number of occurrences of the metric requested during the window of time
trend 0 An indicator of whether the product is currently trending up (1), down (?), or unchaged (0).
trendList 1, 1, 2, 6, 8, 11, 11, 11,12,13

The data points for the requested metric during the window of time. These data points can be used to display a spark line.

salePrice 0 The sale price for the product from the catalog. Note that this currently does not represent the actual sale price for a purchase.
discount 0% The discount for the product from the catalog. Note that this currently does not represent the actual discount with the purchase

 

  • Was this article helpful?