API Reference

POST /v2/indices/{index public key}/recommendations-datasets/{dataset name}/events:batch

Send data to index about items viewed together.

Parameters embedded in the endpoint URL

ParameterDescriptionTypeNotes
Public keyThe public site keystringA site key is an identifier of your AddSearch account that can be found in the dashboard
Dataset nameThe name of the datasetstringDataset name is a name chosen to represent the type of data being sent, e.g. "shopping-cart".

Example payload

{
  "events": [
    { "transaction": "tx1", "item": "DKO-PROF1", "time": "2022-02-26" },
    { "transaction": "tx1", "item": "HEP-91331", "time": "2022-02-26" },
    { "transaction": "tx1", "item": "BCO-2208", "time": "2022-02-26" },
    { "transaction": "tx2", "item": "HEP-91331", "time": "2022-02-26" },
    { "transaction": "tx2", "item": "BCO-2208", "time": "2022-02-26" }
  ]
}
FieldDescriptionTypeNotes
transactionUnique id for the group where the item appearsstringE.g. an unique identifier for the shopping cart where the item was added to.
itemItem's idstringE.g. product id.
timeDate of the eventstringISO 8601 date time string. E.g. "2023-12-31", and "2023-12-31T12:30−02:00"

Example Response

Successful request returns HTTP/1.1 200 OK.

Was this helpful?

Need more help?

We’re always happy to help with code or other questions you might have. Search our documentation, contact support, or connect with our sales team.