Skip to content

Search Term Prediction with our PHP client ‚Äč

The examples below are using our PHP SDK, which is available via Packagist.

Start by making a Searcher-instance.

use Relewise\Searcher;
// You have to `use` the above to create a Searcher.

$searcher = new Searcher(
  "your api key");

To make requests with the SDK you need to use the types from our PHP SDK. The types are located in the namespace Relewise\Models and an example of using a concrete type could be the following:

use Relewise\Models\ProductSearchRequest;

Before going any further, make sure you have read the following:

  • Read about how to authenticate against our API here.
  • Read about handling different types of users here.

Also remember to specify your Server URL in your request.

The following shows an example on how to perform search term predictions with Relewise:

$request = SearchTermPredictionRequest::create(
            "Search overlay",
            take: 10

$response = $searcher->searchTermPrediction($request);

Don't know us? Don't worry - you can find more information about us, by visiting our main page