POST
/
toptimize
/
v1
/
predictions
curl --request POST \
  --url https://api.topsort.com/toptimize/v1/predictions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "metrics": {
    "ctr": true
  },
  "opaqueUserId": "u_9ske45",
  "products": null,
  "ids": [
    "p_PJbnN",
    "p_ojng4"
  ]
}'
{
  "objectType": "listing",
  "predictions": [
    {
      "productId": "p_PJbnN",
      "ctr": 0.03
    },
    {
      "productId": "p_ojng4",
      "ctr": 0.056
    }
  ],
  "error": false
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
The context information for the predictions, including which metrics to predict.
metrics
object
required

Metrics to predict

productIds
string[]
required
opaqueUserId
string

The opaque user ID is an anonymized unique identifier that maps to the original user ID without revealing the original value. This identifier allows Topsort to use interactions information to later on provide a prediction of the outcome of the interaction between the user and a product.

Example:

"71303ce0-de89-496d-8270-6434589615e8"

page
object
objectType
enum<string>

The type of object that is being reported on the interaction.

Available options:
listings,
banners
deviceType
enum<string>
default:desktop

The device for which the ads are meant for.

Available options:
desktop,
mobile

Response

201
application/json
The ranking results. The list of winners will contain at most `slots` entries per auction. It may contain fewer or no entries at all if there aren't enough products to fill the slots.
objectType
enum<string>
required
Available options:
listings,
banners
predictions
object[]
required

Predicted objects.