Recently viewed
const url = 'https://api.shoofai.com/v1/apps/demo-store/recommendations/recently-viewed?userToken=example&limit=8';const options = {method: 'GET', headers: {'x-shoof-api-key': '<x-shoof-api-key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The app’s id, shown in the dashboard (for example ali-sport-goods). demo-store is the public demo app.
Example
demo-storeQuery Parameters
Section titled “Query Parameters”The visitor, as sent with their events.
Comma-separated record ids to leave out, such as the page being viewed.
Responses
Section titled “Responses”The records, newest view first.
object
A record as returned by search, with highlights and ranking details.
object
HTML fragments with matches in <mark>, by field.
object
The passage that best matches the query.
object
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).
object
object
A stable, machine-readable code.
A human-readable explanation.
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.
object
object
A stable, machine-readable code.
A human-readable explanation.
More about the error, such as the validation problems.
Example
{ "error": { "code": "rate_limited", "message": "Rate limit exceeded" }}Headers
Section titled “Headers”Seconds to wait before retrying. Sent with every 429.
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=43The bucket’s quota q per window of w seconds. Sent on every response.
Example
"search";q=600;w=60The requests allowed per window (the older form of RateLimit-Policy).
The requests left in the window.
Seconds until the window resets.