Search

PA’s Search API provides near real-time (less than 100ms) search results for your website. Before you get started, please check with your PA Account Manager that search is approved for your account.

post
Search Request

/1.0/Search
Request
Response
Request
Body Parameters
imageLink
optional
string
If provided, we will use image search as well as text based search for your query For instance, instead of just "red dress" you may also provide an image of a red dress that you want visually similar items to rank higher for Default value: none
size
optional
string
The max number of results you want returned with your query Default value: 20
fuzzy
optional
string
Toggle TRUE/FALSE if you want fuzzy search results to be returned Default value: false
searchFields
optional
array
The fields you want the search query to look into Default value: [title, brand]
personalise
optional
boolean
Toggle TRUE/FALSE if you want to personalise search results returned to you Default value: false
client
required
string
Your client shortcode provided by PA
q
required
string
This defines which query term you want to get search results for
customerId
required
string
The customer ID you want results for
websiteId
required
string
Your website ID provided to you by PA
Response
200: OK
{
"payload": {
"product_info_list": [
{
"attributes": {
"colour": "Walnut",
"price": 1200.0,
"size": "8 Seater"
},
"image_url": "https://XXXX.jpg",
"item_url": "https://XXXX.uk",
"product_ref_id": 21260,
"product_sku_id": 268262,
"product_title": "8 Seater Oval Walnut Dining Table",
"product_type": "Furniture > Dining Room > Dining tables",
"score": 0.9670957669803361
},
{
"attributes": {
"colour": "Silver",
"price": 60.0,
},
"image_url": "https://XXXX.jpg",
"item_url": "https://XXXX.uk",
"product_ref_id": 23210,
"product_sku_id": 780594,
"product_title": "Estelle Silver Round Side Table",
"product_type": "Furniture > Living Room",
"score": 0.7840473618525863
}
],
"website_id": "D6EB943D-CCCCCCXXXXXX-A093EF"
},
"type": 1
}

Example Request

As PA does all the complex computation in the background, the API interface for receiving search results is simple.

curl --request POST 'https://int-api.particularaudience.com/1.0/Search' \
--header 'Content-Type: application/json' \
--data-raw '{
"customerId": "CUSTOMER_ID",
"websiteId": "WEBSITE_ID",
"q": "toothbrush",
"client": "xyz",
"personalise": true,
"searchFields": [
"title",
"brand"
],
"fuzzy": true
}'

Example Response

For all our search APIs, the output is standardised to ensure that our clients have the smoothest experience in integrating different algorithms for different use cases.

{
"payload": {
"product_info_list": [
{
"attributes": {
"colour": "Walnut",
"price": 1200.0,
"size": "8 Seater"
},
"image_url": "https://XXXX.jpg",
"item_url": "https://XXXX.uk",
"product_ref_id": 21260,
"product_sku_id": 268262,
"product_title": "8 Seater Oval Walnut Dining Table",
"product_type": "Furniture > Dining Room > Dining tables",
"score": 0.9670957669803361
},
{
"attributes": {
"colour": "Silver",
"price": 60.0,
},
"image_url": "https://XXXX.jpg",
"item_url": "https://XXXX.uk",
"product_ref_id": 23210,
"product_sku_id": 780594,
"product_title": "Estelle Silver Round Side Table",
"product_type": "Furniture > Living Room",
"score": 0.7840473618525863
}
],
"website_id": "D6EB943D-CCCCCCXXXXXX-A093EF"
},
"type": 1
}