curl --request GET \
--url https://{host}/v1/me/saved-searches/preview \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/v1/me/saved-searches/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/v1/me/saved-searches/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://{host}/v1/me/saved-searches/preview"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"jsonapi": {
"version": "1.0"
},
"meta": {
"suggestedName": "Rolex Submariner, Black",
"labels": [
"Rolex Submariner",
"Black"
],
"matchingWatches": 64,
"reachedLimit": false,
"expectedEmails": {
"instant": 51,
"daily": 24,
"weekly": 5
},
"broad": true,
"threshold": 50,
"duplicate": null
}
}{
"errors": [
{
"status": "404",
"code": "watch_reserved",
"title": "Not Found",
"detail": "<string>",
"meta": {},
"source": {
"pointer": "/data/attributes/reference",
"parameter": "<string>"
}
}
],
"jsonapi": {
"version": "1.0"
}
}{
"errors": [
{
"status": "404",
"code": "watch_reserved",
"title": "Not Found",
"detail": "<string>",
"meta": {},
"source": {
"pointer": "/data/attributes/reference",
"parameter": "<string>"
}
}
],
"jsonapi": {
"version": "1.0"
}
}Preview saved search
Scope: account:read
What the website’s “Save search” modal shows before anything is saved: the name it
would give the search (suggestedName, plus the parts it is built from as labels,
for chips that stay visible once somebody renames it) and how many watches it matched
in the past month with the mails that would have been per interval. Worked out by the
same code as the website and as the broad_search refusal, so the numbers agree.
Ask with the search as you would save it: filter[q] becomes words and every other
filter[...] one of the filters, as POST /v1/me/saved-searches takes them (price in
cents). The facets are the ones /v1/watches hands back.
Not a resource: the answer is in meta. matchingWatches and expectedEmails are
null when the search service could not be asked; saving still works then. broad
says whether saving needs acceptsManyEmails (from threshold matches a month on).
reachedLimit means the count stopped at 1000: show it as “1000+”. duplicate is
the person’s own saved search that is the same search, or null — the one saving
would be refused for with 409 saved_search_exists.
A filter that is not a list of filters is a 400 with invalid_filter.
curl --request GET \
--url https://{host}/v1/me/saved-searches/preview \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{host}/v1/me/saved-searches/preview', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{host}/v1/me/saved-searches/preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://{host}/v1/me/saved-searches/preview"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text){
"jsonapi": {
"version": "1.0"
},
"meta": {
"suggestedName": "Rolex Submariner, Black",
"labels": [
"Rolex Submariner",
"Black"
],
"matchingWatches": 64,
"reachedLimit": false,
"expectedEmails": {
"instant": 51,
"daily": 24,
"weekly": 5
},
"broad": true,
"threshold": 50,
"duplicate": null
}
}{
"errors": [
{
"status": "404",
"code": "watch_reserved",
"title": "Not Found",
"detail": "<string>",
"meta": {},
"source": {
"pointer": "/data/attributes/reference",
"parameter": "<string>"
}
}
],
"jsonapi": {
"version": "1.0"
}
}{
"errors": [
{
"status": "404",
"code": "watch_reserved",
"title": "Not Found",
"detail": "<string>",
"meta": {},
"source": {
"pointer": "/data/attributes/reference",
"parameter": "<string>"
}
}
],
"jsonapi": {
"version": "1.0"
}
}Authorizations
Query Parameters
Response
The preview.
The response is of type object.