affiliate-discovery
Search Affiliate Discovery Products
POST
/
v1
/
discovery
/
products
/
search
Search Affiliate Discovery Products
curl --request POST \
--url https://api.example.com/v1/discovery/products/search \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"criteria": [
{
"field": "on_sale",
"operator": "=",
"value": true
},
{
"field": "in_stock",
"operator": "=",
"value": true
}
],
"criteria_set_ids": [
"summer-sale"
],
"exclude_query": "trail hiking",
"per_page": 25,
"query": "running shoes"
}
'import requests
url = "https://api.example.com/v1/discovery/products/search"
payload = {
"criteria": [
{
"field": "on_sale",
"operator": "=",
"value": True
},
{
"field": "in_stock",
"operator": "=",
"value": True
}
],
"criteria_set_ids": ["summer-sale"],
"exclude_query": "trail hiking",
"per_page": 25,
"query": "running shoes"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
criteria: [
{field: 'on_sale', operator: '=', value: true},
{field: 'in_stock', operator: '=', value: true}
],
criteria_set_ids: ['summer-sale'],
exclude_query: 'trail hiking',
per_page: 25,
query: 'running shoes'
})
};
fetch('https://api.example.com/v1/discovery/products/search', 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://api.example.com/v1/discovery/products/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'criteria' => [
[
'field' => 'on_sale',
'operator' => '=',
'value' => true
],
[
'field' => 'in_stock',
'operator' => '=',
'value' => true
]
],
'criteria_set_ids' => [
'summer-sale'
],
'exclude_query' => 'trail hiking',
'per_page' => 25,
'query' => 'running shoes'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/discovery/products/search"
payload := strings.NewReader("{\n \"criteria\": [\n {\n \"field\": \"on_sale\",\n \"operator\": \"=\",\n \"value\": true\n },\n {\n \"field\": \"in_stock\",\n \"operator\": \"=\",\n \"value\": true\n }\n ],\n \"criteria_set_ids\": [\n \"summer-sale\"\n ],\n \"exclude_query\": \"trail hiking\",\n \"per_page\": 25,\n \"query\": \"running shoes\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/discovery/products/search")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"criteria\": [\n {\n \"field\": \"on_sale\",\n \"operator\": \"=\",\n \"value\": true\n },\n {\n \"field\": \"in_stock\",\n \"operator\": \"=\",\n \"value\": true\n }\n ],\n \"criteria_set_ids\": [\n \"summer-sale\"\n ],\n \"exclude_query\": \"trail hiking\",\n \"per_page\": 25,\n \"query\": \"running shoes\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/discovery/products/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"criteria\": [\n {\n \"field\": \"on_sale\",\n \"operator\": \"=\",\n \"value\": true\n },\n {\n \"field\": \"in_stock\",\n \"operator\": \"=\",\n \"value\": true\n }\n ],\n \"criteria_set_ids\": [\n \"summer-sale\"\n ],\n \"exclude_query\": \"trail hiking\",\n \"per_page\": 25,\n \"query\": \"running shoes\"\n}"
response = http.request(request)
puts response.read_body{
"query": "<string>",
"page_index": 123,
"page_size": 123,
"items": [
{
"slug": "<string>",
"id": "<string>",
"name": "<string>",
"image_url": "<string>",
"product_url": "<string>",
"merchant_url": "<string>",
"price": {
"currency": "<string>",
"regular_value": 123,
"final_value": 123,
"on_sale": true,
"sale_discount": 123
},
"type": "product",
"merchant": {
"id": "<string>",
"name": "<string>",
"logo_url": "<string>"
},
"brand": "<string>",
"category": "<string>",
"availability": "<string>"
}
],
"next_cursor": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Body
application/json
Free-text query string.
Minimum string length:
1Saved criteria set IDs to apply to this first-page search.
Negative free-text provider filter applied to 'name||description||brand'.
Minimum string length:
1criteria
(AnyCriterion · object | NameDescriptionBrandCriterion · object | BrandCriterion · object | CategoryCriterion · object | ColorCriterion · object | ConditionCriterion · object | CountryCriterion · object | GenderCriterion · object | GenreCriterion · object | ManufacturerCriterion · object | MaterialCriterion · object | ModelCriterion · object | PublisherCriterion · object | SizeCriterion · object | SubtitleCriterion · object | TagsCriterion · object | CurrencyCriterion · object | OnSaleCriterion · object | SaleDiscountCriterion · object | RegularPriceCriterion · object | FinalPriceCriterion · object | SalePriceCriterion · object | ShipPriceCriterion · object | IdCriterion · object | BarcodeCriterion · object | SkuCriterion · object | MpnCriterion · object | AsinCriterion · object | MerchantIdCriterion · object | MerchantNameCriterion · object | SellerPartyCriterion · object | MerchantCategoryIdsCriterion · object | InStockCriterion · object | StockQuantityCriterion · object | AvailabilityCriterion · object)[]
Structured filters applied in addition to the free-text query.
- AnyCriterion
- NameDescriptionBrandCriterion
- BrandCriterion
- CategoryCriterion
- ColorCriterion
- ConditionCriterion
- CountryCriterion
- GenderCriterion
- GenreCriterion
- ManufacturerCriterion
- MaterialCriterion
- ModelCriterion
- PublisherCriterion
- SizeCriterion
- SubtitleCriterion
- TagsCriterion
- CurrencyCriterion
- OnSaleCriterion
- SaleDiscountCriterion
- RegularPriceCriterion
- FinalPriceCriterion
- SalePriceCriterion
- ShipPriceCriterion
- IdCriterion
- BarcodeCriterion
- SkuCriterion
- MpnCriterion
- AsinCriterion
- MerchantIdCriterion
- MerchantNameCriterion
- SellerPartyCriterion
- MerchantCategoryIdsCriterion
- InStockCriterion
- StockQuantityCriterion
- AvailabilityCriterion
Show child attributes
Show child attributes
Example:
{
"field": "any",
"operator": "not_like",
"value": "trail hiking"
}
Maximum number of products requested for the page.
Required range:
1 <= x <= 100Opaque cursor returned by a previous search response.
⌘I
Search Affiliate Discovery Products
curl --request POST \
--url https://api.example.com/v1/discovery/products/search \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"criteria": [
{
"field": "on_sale",
"operator": "=",
"value": true
},
{
"field": "in_stock",
"operator": "=",
"value": true
}
],
"criteria_set_ids": [
"summer-sale"
],
"exclude_query": "trail hiking",
"per_page": 25,
"query": "running shoes"
}
'import requests
url = "https://api.example.com/v1/discovery/products/search"
payload = {
"criteria": [
{
"field": "on_sale",
"operator": "=",
"value": True
},
{
"field": "in_stock",
"operator": "=",
"value": True
}
],
"criteria_set_ids": ["summer-sale"],
"exclude_query": "trail hiking",
"per_page": 25,
"query": "running shoes"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
criteria: [
{field: 'on_sale', operator: '=', value: true},
{field: 'in_stock', operator: '=', value: true}
],
criteria_set_ids: ['summer-sale'],
exclude_query: 'trail hiking',
per_page: 25,
query: 'running shoes'
})
};
fetch('https://api.example.com/v1/discovery/products/search', 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://api.example.com/v1/discovery/products/search",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'criteria' => [
[
'field' => 'on_sale',
'operator' => '=',
'value' => true
],
[
'field' => 'in_stock',
'operator' => '=',
'value' => true
]
],
'criteria_set_ids' => [
'summer-sale'
],
'exclude_query' => 'trail hiking',
'per_page' => 25,
'query' => 'running shoes'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/discovery/products/search"
payload := strings.NewReader("{\n \"criteria\": [\n {\n \"field\": \"on_sale\",\n \"operator\": \"=\",\n \"value\": true\n },\n {\n \"field\": \"in_stock\",\n \"operator\": \"=\",\n \"value\": true\n }\n ],\n \"criteria_set_ids\": [\n \"summer-sale\"\n ],\n \"exclude_query\": \"trail hiking\",\n \"per_page\": 25,\n \"query\": \"running shoes\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/discovery/products/search")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"criteria\": [\n {\n \"field\": \"on_sale\",\n \"operator\": \"=\",\n \"value\": true\n },\n {\n \"field\": \"in_stock\",\n \"operator\": \"=\",\n \"value\": true\n }\n ],\n \"criteria_set_ids\": [\n \"summer-sale\"\n ],\n \"exclude_query\": \"trail hiking\",\n \"per_page\": 25,\n \"query\": \"running shoes\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/discovery/products/search")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"criteria\": [\n {\n \"field\": \"on_sale\",\n \"operator\": \"=\",\n \"value\": true\n },\n {\n \"field\": \"in_stock\",\n \"operator\": \"=\",\n \"value\": true\n }\n ],\n \"criteria_set_ids\": [\n \"summer-sale\"\n ],\n \"exclude_query\": \"trail hiking\",\n \"per_page\": 25,\n \"query\": \"running shoes\"\n}"
response = http.request(request)
puts response.read_body{
"query": "<string>",
"page_index": 123,
"page_size": 123,
"items": [
{
"slug": "<string>",
"id": "<string>",
"name": "<string>",
"image_url": "<string>",
"product_url": "<string>",
"merchant_url": "<string>",
"price": {
"currency": "<string>",
"regular_value": 123,
"final_value": 123,
"on_sale": true,
"sale_discount": 123
},
"type": "product",
"merchant": {
"id": "<string>",
"name": "<string>",
"logo_url": "<string>"
},
"brand": "<string>",
"category": "<string>",
"availability": "<string>"
}
],
"next_cursor": "<string>",
"expires_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}