subbe/semantics3

This package is abandoned and no longer maintained. No replacement package was suggested.

The Most Comprehensive Suite of Product API

1.0 2016-08-05 04:19 UTC

This package is not auto-updated.

Last update: 2018-12-22 17:17:32 UTC


README

Latest Stable Version Total Downloads Latest Unstable Version License

Semantics3 is a laravel package built using the lib\semantics3 php library giving access to Semantics3 API which lets you retrieve metadata for millions of products.

Install

1 -

Open terminal and from the root of your project,

composer require subbe/semantics3
2 -

Open the file config\app.php

Add the following line to the providers array

Subbe\Semantics3\Semantics3ServiceProvider::class,

3 -

php artisan vendor:publish

running this commad will publish the semantics3config.php in the projects config folder. The file return an array with 2 values, 'SEMANTICS3_SECRET_KEY' and 'SEMANTICS3_PUBLIC_KEY'.

4 -

To use this package, you will need to register on semantics3.

Once you are registered and logged in, go to Application and you will find the keys required to use the API.

Update the projects .env file as required and it should look something like this.

SEMANTICS3_SECRET_KEY=ZHFAJHS************
SEMANTICS3_PUBLIC_KEY=SEM****************

replace the keys with the ones provided by Semantics3.

Usage

Add this,

use Subbe\Semantics3\Semantics3;

Semantics3::search($item);

$item = Semantic3::search('iphone');

This returns product information based on the search term 'iphone'.

Semantics3::brand($item);

$item = Semantic3::brand('apple');

This returns products information based on the brand name 'apple'

Semantics3::upc($item);

$item = Semantic3::upc('0885909950942');

This returns product information based on the UPC/EAN/GTIN '0885909950942'

Semantics3::site_query($item, $site);

$item = Semantics3::site_query('iphone', 'amazon.com');

This returns product information based on the search term 'iphone' from the website 'amazon.com'

Alternatively, you can use this as

$sem = new Semantics3();
$search = $sem->search('iphone');
$upc = $sem->upc('0885909950942');
$site = $sem->site_query('iphone', 'amazon.com');
$site = $sem->categories('hard drives');

THANK YOU