Skip to content

Recently viewed

GET
/v1/apps/{appId}/recommendations/recently-viewed
curl --request GET \
--url 'https://api.shoofai.com/v1/apps/demo-store/recommendations/recently-viewed?userToken=example&limit=8' \
--header 'x-shoof-api-key: <x-shoof-api-key>'

What one visitor viewed lately, newest first, from the view and click events sent with their userToken. Starter and up. Does not count as a search.

appId
required
string

The app’s id, shown in the dashboard (for example ali-sport-goods). demo-store is the public demo app.

Example

demo-store
userToken
required
string

The visitor, as sent with their events.

exclude
string

Comma-separated record ids to leave out, such as the page being viewed.

limit
integer
default: 8
lang
string

The records, newest view first.

Media typeapplication/json
object
hits
Array<object>

A record as returned by search, with highlights and ranking details.

object
id
required
string
type
required
string
title
required
string
url
string
image
string
_highlight

HTML fragments with matches in <mark>, by field.

object
key
additional properties
Array<string>
_snippet

The passage that best matches the query.

string
_score
number
_rankingInfo
object
lexicalRank
integer
semanticRank
integer
pinned
boolean
learnedBoost
number
key
additional properties
any

Example generated

{
"hits": [
{
"id": "example",
"type": "example",
"title": "example",
"url": "example",
"image": "example",
"_highlight": {
"additionalProperty": [
"example"
]
},
"_snippet": "example",
"_score": 1,
"_rankingInfo": {
"lexicalRank": 1,
"semanticRank": 1,
"pinned": true,
"learnedBoost": 1
}
}
]
}

The key can’t do this (forbidden), the origin isn’t allowed for the key, or the feature isn’t in the plan (feature_not_in_plan) or is switched off for the app (feature_disabled).

Media typeapplication/json
object
error
required
object
code
required

A stable, machine-readable code.

string
message
required

A human-readable explanation.

string
details

More about the error, such as the validation problems.

Example generated

{
"error": {
"code": "example",
"message": "example",
"details": "example"
}
}

Too many requests in this window (rate_limited). Wait Retry-After seconds, then retry.

Media typeapplication/json
object
error
required
object
code
required

A stable, machine-readable code.

string
message
required

A human-readable explanation.

string
details

More about the error, such as the validation problems.

Example

{
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded"
}
}
Retry-After
integer

Seconds to wait before retrying. Sent with every 429.

RateLimit
string

What’s left in the window (IETF draft-ietf-httpapi-ratelimit-headers): the bucket’s name, r the requests left and t the seconds until the window resets. Sent on every response.

Example
"search";r=597;t=43
RateLimit-Policy
string

The bucket’s quota q per window of w seconds. Sent on every response.

Example
"search";q=600;w=60
RateLimit-Limit
integer

The requests allowed per window (the older form of RateLimit-Policy).

RateLimit-Remaining
integer

The requests left in the window.

RateLimit-Reset
integer

Seconds until the window resets.