class ResearchClient implements ResearchClientInterface

Class ResearchClient

An implementation of a client capable of querying the SellerLabs Research API.

Methods

setClient(Client $client)

Overrides the internal guzzle client.

__construct(string $clientId, string $secret, string $endpoint)

Construct an instance of a ResearchClient

string
generateCode(null|int $timestamp = null)

Generate an authorization code for the Research API server.

getOffers(string $asin, bool $noPaapi = false)

Get the current offers for an ASIN from the Research API.

getFees(string $asin, float $price)

Call the fees endpoint of the Research API and return the response.

getSearch(string $idType, string $idCode)

Search the catalog and return the response

getAsinCategories(string $asin)

Get categories for an ASIN

getCategoryById(string $categoryId)

Get a category by ID

getItemSearch(string $keywords, int $page = 1, string $searchIndex = 'Blended')

Hit the itemSearch endpoint of research-api with a given keyword phrase, page (default 1) and search index (default Blended)

Details

at line line 71
setClient(Client $client)

Overrides the internal guzzle client.

Mainly used for testing.

Parameters

Client $client

at line line 83
__construct(string $clientId, string $secret, string $endpoint)

Construct an instance of a ResearchClient

Parameters

string $clientId
string $secret
string $endpoint

at line line 107
string generateCode(null|int $timestamp = null)

Generate an authorization code for the Research API server.

Parameters

null|int $timestamp

Return Value

string

at line line 135
OffersResponse getOffers(string $asin, bool $noPaapi = false)

Get the current offers for an ASIN from the Research API.

Parameters

string $asin
bool $noPaapi

Return Value

OffersResponse

at line line 164
FeesResponse getFees(string $asin, float $price)

Call the fees endpoint of the Research API and return the response.

Parameters

string $asin
float $price

Return Value

FeesResponse

at line line 189
SearchResponse getSearch(string $idType, string $idCode)

Search the catalog and return the response

Parameters

string $idType
string $idCode

Return Value

SearchResponse

at line line 214
GetAsinCategoriesResponse getAsinCategories(string $asin)

Get categories for an ASIN

Parameters

string $asin

Return Value

GetAsinCategoriesResponse

at line line 232
GetCategoryByIdResponse getCategoryById(string $categoryId)

Get a category by ID

Parameters

string $categoryId

Return Value

GetCategoryByIdResponse

at line line 253
ItemSearchResponse getItemSearch(string $keywords, int $page = 1, string $searchIndex = 'Blended')

Hit the itemSearch endpoint of research-api with a given keyword phrase, page (default 1) and search index (default Blended)

Parameters

string $keywords
int $page
string $searchIndex

Return Value

ItemSearchResponse