PHP Wrapper
Apiki_Buscape_API class was created to help in developing applications using web services API provided by Buscapé.
How it works?
The class Apiki_Buscape_API pre-configures your application to integrate with the API Buscapé, ie, it facilitates the integration and speeds development of applications.
How to use?
To use the class Apiki_Buscape_API you must follow these steps:
- Download the class Apiki_Buscape_API.
- Set it to a directory on your application.
- Instantiate the class.
- Use your body set up to call the methods of the class.
Methods
The class contains methods Apiki_Buscape_API based on each service provided by the API Buscapé.
-
findCategoryList
Search for a category list of products or offers. -
findOfferList
Search all offers of a particular product, filtering for APPRAISAL store, price or popularity. -
findProductList
Search for products by one or more keywords or category ID. -
topProducts
Search the most popular products of Buscapé. -
viewProductDetails
Search the technical details of a particular product. -
viewSellerDetails
Search contacts and addresses for a specific store or company. -
viewUserRatings
Search the evaluations of users of a particular product.
findCategoryList
Search method categories and allows you to display information relating to them.
All necessary parameters for the search are reported in an array that must be passed to the method.
| Parameters array | Type | Description |
|---|---|---|
| categoryId | Int | Category ID |
| keyword | String | Keywords |
| callback | String | Callback function to be executed as if you're using JSON return format |
Note: If not informed any of the parameters, the method returns a list of categories of the root 0.
Example
// Instantiate class Apiki_Buscape_API
$objApikiBuscapeApi = new Apiki_Buscape_API( $applicationID );
// Gets the method's return
$retorno = $objApikiBuscapeApi->findCategoryList( array( 'categoryId' => 77, 'keyword' => 'celular,nokia' ) );
To learn about the data and parameters returned by this method, see the documentation on the service.
findOfferList
Search method a list of offerings.
All necessary parameters for the search are reported in an array that must be passed to the method.
| Parameters array | Type | Description |
|---|---|---|
| categoryId | Int | Category ID |
| keyword | String | Keywords |
| productId | Int | Product ID |
| barcode | String | Barcode Product |
| callback | String | Callback function to be executed as if you're using JSON return format |
Note: At least one of the search parameters should be informed. The parameters 'categoryId' and 'keyword' may be used together to search keywords in a particular category.
Example
// Instantiate class Apiki_Buscape_API
$objApikiBuscapeApi = new Apiki_Buscape_API( $applicationID );
// Gets the method's return
$retorno = $objApikiBuscapeApi->findOfferList( array( 'productId' => 10500 ) );
To learn about the data and parameters returned by this method, see the documentation on the service..
findProductList
Method searches for products and allows you to get a list of products using the unique ID of the final category, a set of keywords or both.
All necessary parameters for the search are reported in an array that must be passed to the method.
| Parameters array | Type | Description |
|---|---|---|
| categoryId | Int | Category ID |
| keyword | String | Keywords |
| callback | String | Callback function to be executed as if you're using JSON return format |
Note: At least one of the search parameters should be informed. The parameters 'categoryId' and 'keyword' may be used together to search keywords in a particular category.
Example
// Instantiate class Apiki_Buscape_API
$objApikiBuscapeApi = new Apiki_Buscape_API( $applicationID );
// Gets the method's return
$retorno = $objApikiBuscapeApi->findProductList( array( 'keyword' => 'celular', 'callback' => 'nome_da_funcao' ) );
To learn about the data and parameters returned by this method, see the documentation on the service..
topProducts
Method returns the most popular products of cod.
All necessary parameters for the search are reported in an array that must be passed to the method.
| Parameters array | Type | Description |
|---|---|---|
| callback | String | Callback function to be executed as if you're using JSON return format |
Example
// Instantiate class Apiki_Buscape_API
$objApikiBuscapeApi = new Apiki_Buscape_API( $applicationID );
// Gets the method's return
$retorno = $objApikiBuscapeApi->topProducts();
To learn about the data and parameters returned by this method, see the documentation on the service..
viewProductDetails
Method returns the technical details of a product.
All necessary parameters for the search are reported in an array that must be passed to the method.
| Parameters array | Type | Description |
|---|---|---|
| productId | Int | Product ID |
| callback | String | Callback function to be executed as if you're using JSON return format |
Note: The product ID is required.
Example
// Instantiate class Apiki_Buscape_API
$objApikiBuscapeApi = new Apiki_Buscape_API( $applicationID );
// Gets the method's return
$retorno = $objApikiBuscapeApi->viewProductDetails( array( 'productId' => 1000 ) );
To learn about the data and parameters returned by this method, see the documentation on the service..
viewSellerDetails
Method returns the details of the store or company
All necessary parameters for the search are reported in an array that must be passed to the method.
| Parameters array | Type | Description |
|---|---|---|
| sellerId | Int | Store / business ID |
| callback | String | Callback function to be executed as if you're using JSON return format |
Note: The ID of the store / company is required.
Example
// Instantiate class Apiki_Buscape_API
$objApikiBuscapeApi = new Apiki_Buscape_API( $applicationID );
// Gets the method's return
$retorno = $objApikiBuscapeApi->viewSellerDetails( array( 'sellerId' => 335525 ) );
To learn about the data and parameters returned by this method, see the documentation on the service..
viewUserRatings
Method returns the evaluations of users about a particular product.
All necessary parameters for the search are reported in an array that must be passed to the method.
| Parameters array | Type | Description |
|---|---|---|
| productId | Int | Product ID |
| callback | String | Callback function to be executed as if you're using JSON return format |
Note: The product ID is required.
Example
// Instantiate class Apiki_Buscape_API
$objApikiBuscapeApi = new Apiki_Buscape_API( $applicationID );
// Gets the method's return
$retorno = $objApikiBuscapeApi->viewUserRatings( array( 'productId' => 1000 ) );
To learn about the data and parameters returned by this method, see the documentation on the service.
