FINDOLOGIC-API is an object oriented wrapper for the Findologic API, with over 300 automated unit-tests and 100% code coverage.
This library not only helps requesting the Findologic API, but also getting data from the response and mapping them to corresponding objects. You won't have to mess around with sending requests and getting the data from the Findologic's response anymore.
You want to get filters? Just call Response::getMainFilters()
. It really is that simple, just
try out the Basic Usage or see some Examples.
To have a better understanding about the API, please make sure to read the general Findologic API documentation. We already got you covered with quicklinks to it:
Currently, we support the following response formats:
Response Type | Format | Version | Supported | End of life |
---|---|---|---|---|
Search/Navigation | JSON | 1.0 | :heavy_check_mark: | Not in the foreseeable future |
XML | 2.1 | :heavy_check_mark: | Not in the foreseeable future | |
XML | 2.0 | :heavy_multiplication_x: → Use XML_2.1 instead | 2019-10-18 | |
HTML | any | :heavy_check_mark: → The response is not parsed | Not in the foreseeable future | |
Smart Suggest | JSON | 3.0 | :heavy_check_mark: | Not in the foreseeable future |
Item Update | JSON | latest | :heavy_check_mark: | Not in the foreseeable future |
For a simple installation you can use Composer. Using this command will install the latest version.
composer require findologic/findologic-api
The usage is pretty simple. Here is an example:
// Require composer autoload
require_once __DIR__ . '/vendor/autoload.php';
use FINDOLOGIC\Api\Config;
use FINDOLOGIC\Api\Client;
use FINDOLOGIC\Api\Requests\Request;
use FINDOLOGIC\Api\Requests\SearchNavigation\SearchRequest;
use FINDOLOGIC\Api\Responses\Json10\Json10Response;
// Set your ServiceId/Shopkey, which can be found in the customer account.
$config = new Config('ABCDABCDABCDABCDABCDABCDABCDABCD');
$client = new Client($config);
/** @var SearchRequest $request */
$request = Request::getInstance(Request::TYPE_SEARCH);
$request->setQuery('shirt') // Users search query.
->setShopUrl('blubbergurken.de') // Url of the shop.
->setUserIp('127.0.0.1') // Users IP.
->setReferer($_SERVER['HTTP_REFERER']) // Page where search was fired.
->setRevision('1.0.0') // Version of your API wrapper.
->setOutputAdapter('JSON_1.0'); // Optional setting of output format.
/** @var Json10Response $response */
$response = $client->send($request);
var_dump($response->getResult()->getItems()); // Get all products/items.
var_dump($response->getResult()->getMainFilters()); // Get all main filters easily.
var_dump($response->getResult()->getOtherFilters()); // Get all other filters easily.
var_dump($response); // Entire response, full of helper methods.
/examples
directory.We need your help! If you find any bug, please submit an issue and use our template! Be as precise as possible so we can reproduce your case easier. For further information, please refer to our issue template at .github/ISSUE_TEMPLATE/bug_report.md.
Please check our contribution guide on how to contribute.