findologic / findologic-api
Library for FINDOLOGIC API requests
Installs: 87 957
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 6
Forks: 3
Open Issues: 5
Requires
- php: >=8.1
- ext-dom: *
- ext-json: *
- ext-libxml: *
- ext-simplexml: *
- findologic/xml-response-schema: ^2.1
- guzzlehttp/guzzle: ^7.4.5
- vlucas/valitron: ^1.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^v3.18.0
- phpunit/phpunit: ^9.6.9
- dev-develop
- v2.0.0
- v1.8.0
- v1.7.0
- v1.6.1
- v1.6.0
- v1.5.1
- v1.5.0
- v1.4.0
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.2
- v1.0.1
- v1.0.0
- v1.0.0-beta.4
- v1.0.0-beta.3
- v1.0.0-beta.2
- v1.0.0-beta.1
- v0.2.0
- v0.1.0
- dev-migrate_to_php_7_4
- dev-main
- dev-restructure_parameter_setting
- dev-backward-compatible
- dev-send_user_agent
- dev-add_php_74_support
This package is auto-updated.
Last update: 2024-10-19 17:32:32 UTC
README
Synopsis
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:
- Requesting the API
- Response: XML | API spec (non-interactive)
- Response: JSON | API spec (interactive) | API spec (non-interactive)
Limitations
Currently, we support the following response formats:
Requirements
- PHP >= 8.1
- PHP curl extension (optional)
- Composer
Installation
For a simple installation you can use Composer. Using this command will install the latest version.
composer require findologic/findologic-api
Basic usage
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
- Working examples can be found in the
/examples
directory. - The documentation can be found in our Project Wiki.
Projects using this library
- FINDOLOGIC Shopware 6 plugin
- FINDOLOGIC Shopware 5 plugin
- Simple Symfony 5 demo (shows a simple FINDOLOGIC-API integration)
- Many more to come...
Bug Report
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.
Contributing
Please check our contribution guide on how to contribute.