Content search API (Site Crawl) - Bloomreach Experience - Open Source CMS

Content search API (Site Crawl)

Site Crawl Content Search is based on parsing content from the merchant's site and returning search results based on the content we find on their websites through the crawl. The ranking is based purely on text-match. This kind of content is called unstructured content, and it doesn't adhere to a defined data model like your products do. Unlike feed-based content searches, crawl based content search queries don't rely on a feed.

We recommend you to move to Feed Based Content Search for algo based capabilities derived from inputs such as a structured content feed and user-behavior data tracked through the pixel. Talk to your Bloomreach representative about how to get you started with the latest Content Search.  

Example request

Here's an example request that searches for Valencian paella

GET http://core.dxpapi.com/api/v1/core/?
&account_id=<Bloomreach Provided Account ID>
&auth_key=jazzhands
&domain_key=example_com
&request_id=1597706996836
&_br_uid_2=uid=7797686432023:v=11.5:ts=1428617911187:hc=55
&ref_url=http://www.example.com/home
&url=http://www.example.com/index.html?q=cooking%20valencian%20paella
&data_type=content
&request_type=search
&search_type=keyword
&q=cooking valencian paella
&fl=cid,title,author
&rows=10
&start=0

Request parameters

These are the parameters used in the example request. Every non-product content search request needs these parameters. 

Before getting started, read about the Escape characters and encoding here.
Parameter Details
_br_uid_2

A first-party cookie created by the Bloomreach tracking pixel library (BrTrk). This cookie creates a unique, anonymous identifier for every browser or device.

Don't encode the cookie parameter value: _br_uid_2. Use this value exactly as it comes. It's already encoded.

 &_br_uid_2=uid%3D7797686432023%3Av%3D11.5%3Ats%3D1428617911187%3Ahc%3D55

Value type

String

Example value

&_br_uid_2=uid%3D7797686432023%3Av%3D11.5%3Ats%3D1428617911187%3Ahc%3D55

Required

Mandatory

account_id

Your site's numerical Bloomreach account ID. Your Bloomreach representative gives your site's account ID to you before or during your integration kickoff meeting.

Notify your Bloomreach representative
If you don't have a Bloomreach account ID, then let your Bloomreach representative know immediately. You can't send any API calls without your account ID.

Value type

Integer

Example value

&account_id=<Bloomreach Provided Account ID>

Required

Mandatory

auth_key

auth_key

 

The Bloomreach-provided authentication key for the Bloomreach account that's sending the request.

Leave auth_key parameter values empty for client-side calls

If you use client-side calls for any of your Bloomreach requests, then do not enter an auth_key value in those client-side calls. Pass the auth_key with an empty value in client-side calls.

The auth_key value is a private authorization key. If you include your valid auth_key value in client-side calls, then you inadvertently expose that private information to everybody.

Value type

string

Required

Mandatory

Example value

&auth_key=jazzhands

Your own auth_key value looks very different from this example. We're using an odd example value to reinforce the importance of treating this key like you treat other keys like your email login credentials: don't share it.

url

The absolute URL of the page where the request is initiated.

Use the absolute URL

Don't use a relative URL for your url parameter value.

Value type

string

Example value

&url=http://www.example.com/index.html?query=dresses

Required

Mandatory

domain_key

Your site domain's ID, which is provided by Bloomreach. This ID is for the domain that you want to receive your Bloomreach API requests.

This parameter identifies the specific site version when the one account ID hosts multiple site versions with unique characteristics, such as language versions. Bloomreach uses your domain_key parameter value to ensure that only the data that pertains to that site version is used.

Value type

string

Example value

&domain_key=example_com

Required

Mandatory

data_type
In Pilot Phase

Identifies the request as a content search. Use the value, content.

Value type

string (enum)

Example value

&data_type=content

fl

The attributes that you want returned in your API response, such as item_id and item_title. All fl parameters must include item_id as one of their values. You can include other attributes from your content feed.

Tip
Include all the attributes from your content feed that you want to include in search results, not just the attributes that you want to be returned as objects in your API response. Your search results pages are built from your API responses. Therefore, search results pages can only include attributes that are returned in API responses.

Value type

string

Example value for Content

&fl=item_id,item_title,brand,price,sale_price,thumb_image,url,description

Separate multiple attributes with a comma: &fl=item_pid,item_title,thumb_image

ref_url

The URL of the page or HTTP referer where the request is started.

Use the absolute URL

Don't use a relative URL for your ref_url parameter value.

Value type

string

Example value

&ref_url=http://www.example.com/home

Required

Only mandatory if you want to use Targeting

request_id

An ID to track site visitor clicks. We recommend that you generate unique, random values of 13 digits to enable click-tracking.

The request_id is an important parameter for debugging so it is important that you send this. 

Value type

string

Example value

&request_id=1597706996836

Required

Mandatory

request_type The type of API request. Choose the value that fits your use case:
  • search
  • suggest
  • jfy
  • mlt
  • thematic

Value type

string (enum)

Use search for content search API calls

The only correct &request_type value for a content search API call is search.

q

Your site visitor's search query. Search queries are composed of one or more terms.

→ Tip ← 
You can percent encode spaces between terms, or you can leave the spaces the way they are. The correct code is %20 if you choose to percent encode spaces in multi-term search queries.

Value type

string

Example value

&q=cooking valencian paella

rows

The number of matching items to return per results page in the API response. The maximum value is 200. The result size is used from the Dashboard if it is not sent in the API.

Tip

To enhance performance, limit this value to the number of items that you think is reasonable for a single page of search results.

Value type

Integer

Example value

&rows=10

Required

Optional

search_type

The type of search. Choose the value that fits your use case:

  • keyword
  • category

Value type

string (enum)

Use keyword for this tutorial's use case

The only correct &search_type value for this content search's use case is keyword.

start

The number of the first item on a page of results. For example, the first item on the first page is 0, making the start value also 0. The maximum value is 10000.

Value type

integer

Example value

&start=0

url

The absolute URL of the page where the request is initiated.

Use the absolute URL

Don't use a relative URL for your url parameter value.

Value type

string

Example value

&url=http://www.example.com/index.html?q=dresses

Use case-dependent parameters

These parameters are for specific product search use cases. Each parameter has a section that tells you which use cases require the parameter.

Parameter Details
callback

Indicates whether to return data wrapped in the function for cross-origin requests.

If you're running a server-side request, then use the value, br_server. If you're running a native-app request, then use the value, br_app.

Value type

string (enum)

Example value

&callback=br_server

Use case

Return data wrapped in the function for cross-origin requests.

efq

Applies a complex boolean filter to search results to include or exclude items that fit your parameter values. Any product attribute in your product feed is valid, such as brand names and sizes. Typically, the efq parameter is used for custom attributes that you include in your product feed to support additional business logic that you might need to filter.

 efq or fq?
Values for the efq parameter are similar to values for the fq parameter. The difference between efq and fq is that efq supports complex boolean searches and fq filters on facets. You can use the fq parameter with the efq parameter to apply more complex filtering.

Value type

String

Example value

&efq=color:"red" OR "purple" OR "pink"

Use case

Apply complex filtering to search results.

More information: efq syntax

Surround attributes in your value with quotes. For example:

brand:"Fossil"

If the attribute in the efq parameter contains a space, surround the attribute with quotes. For example:

"Product Type":"1"

If you have multiple values, then surround the entire value with parentheses. For example:

brand:("Fossil" OR "Betsey Johnson")

Please note that if the value has quote within it, then the quote should be escaped with '\', e.g. Sheet Dimension = 8.5" x 11".

In this case the fq should be:

Sheet Dimension:"8.5\" x 11\""

In this case the efq should be:

"Sheet Dimension":"8.5\" x 11\""

To apply filters for a ranged facet, such as price or sale price, the ranged value needs to be specified in addition to the product attribute.

For example: to limit results to products with a price below 100:

price:[* TO 100]

Or to limit results to products with a price between 200 and 300:

price:[200 TO 300]

facet.range

Return a count of ranged facets, such as cook time. Use numeric attributes only.

Value type

string

Example value

&facet.range=cook_time

Use case

Apply ranged filtering to search results.

fq

 

The fq parameter applies a faceted filter to the returned content, searching for content that fit your parameter values. Any facet that you want to filter must be in your content feed.

Attributes must be enabled and mapped by Bloomreach
Let your Bloomreach representative know which attributes in your content feed that you want to apply as filters to search results.

The fq parameter filters results to include only relevant items. For example, a major sports league has a website that displays information about every team in the league. The league has 32 teams, and each team has its own game stats, bio of each player and recent news on the recent happenings. Showing all of these items to a customer is overwhelming, causing customers difficulty when they try to find exactly what they're looking for. You can use the fq parameter in your API calls to suggest to website users only content from the teams they're interested in looking at.

Surround individual attributes in fq values with double quotes. If you are using multiple attributes in your fq value, then separate the attributes with OR or AND.

Value type

string

Example value

&fq=color:"red" OR "purple" OR "pink"

 

 More information: fq syntax

Surround attributes in your value with quotes. For example:

brand:"Fossil"

If the attribute in the efq parameter contains a space, surround the attribute with quotes. For example:

"Product Type":"1"

If you have multiple values, then surround the entire value with parentheses. For example:

brand:("Fossil" OR "Betsey Johnson")

Please note that if the value has quote within it, then the quote should be escaped with '\', e.g. Sheet Dimension = 8.5" x 11".

In this case the fq should be:

Sheet Dimension:"8.5\" x 11\""

In this case the efq should be:

"Sheet Dimension":"8.5\" x 11\""

To apply filters for a ranged facet, such as price or sale price, the ranged value needs to be specified in addition to the product attribute.

For example: to limit results to products with a price below 100:

price:[* TO 100]

Or to limit results to products with a price between 200 and 300:

price:[200 TO 300]

Use case

Apply filtering to search results.

Specify a particular type of non-product content.

sort

Sorts results based on the field value in ascending, descending, or another combination of orders. You can use one of the following values:

  • launch_date desc sorts in descending order of the date on which content launched

  • launch_date asc sorts in descending order of the date on which content launched

Value type

string (enum)

Use case

Sort search results by certain attributes.

view_id

A unique identifier for a specific view of your content catalog. If you have multiple versions of your site, each with their own content catalog characteristics like content titles and descriptions, then add view_id to your call. Bloomreach uses your view_id parameter value to display the right product information for your customers based on their individual site views.

You can enter any string value to identify the specific site catalog view. This string must be consistent in your pixel, API, and content catalog. For example, Abacus Thinking sells different academic products to different grade levels. A first grade teacher looks in their Kindergarten through Grade 3 catalog, which Abacus Thinking assigns the ID, k-3:

&view_id=k-3

 Consistent, valid values
Your view_id values must be the same in your API, pixel, and content catalog. If Abacus Thinking assigns the value, ACA-MAX, to the view_id parameter in their content feed, then the parameter value, academia maximiliano, doesn't match any catalog view.

Value type

string

Use case

Search a specific view of a site with multiple versions.

user_id

The universal customer ID of the user. You only need to pass this field if your particular integration tracks customers this way.

The parameter captures user IDs from the customer side, and reuses the information when powering apps or enhancing cross-device linking. In this way, Bloomreach recognizes users in a way that's aligned with your system. Use an anonymous string. Don't use email or other personally identifiable information. If you do not track users this way, then omit this field.

Value type

string

Example value

&user_id=947345478564

Track individual site visitor behavior.

wt

Specifies the type of response. Use one of the following values:

  • json is the default response type

  • html requires an html template integration

Value type

string (enum)

Example value

&wt=html

Use case

Return results in HTML.

 

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?