PHPackages                             mesingh/envato-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. mesingh/envato-api

ActiveLibrary[API Development](/categories/api)

mesingh/envato-api
==================

This is a PHP wrapper class for the Envato marketplaces - like themeforest.net.

1211PHP

Since Oct 22Pushed 12y ago1 watchersCompare

[ Source](https://github.com/DepreBot/Envato-Marketplace-API-Wrapper-in-PHP)[ Packagist](https://packagist.org/packages/mesingh/envato-api)[ RSS](/packages/mesingh-envato-api/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

This class is a wrapper for the Envato Marketplace API. It provides easy-to-remember methods to view your items, search the marketplace, get personal, private data, view collections, etc. It also will automatically caches the results - so that you don't hammer the API needlessly!

### Usage

[](#usage)

First, include the class in your project.

`require 'Envato_marketplaces.php';`

Next, create a new instance of the class:

`$Envato = new Envato_marketplaces();`

And that's really it. You now have access to all of the available functions.

### Examples

[](#examples)

#### Quickly Echo Thumbnails of a User's Items

[](#quickly-echo-thumbnails-of-a-users-items)

```
$Envato = new Envato_marketplaces();
$Envato->display_thumbs('your username', 'desired marketplace name', 'number to display');

```

#### Search for Sliders Across all Marketplaces

[](#search-for-sliders-across-all-marketplaces)

```
$Envato = new Envato_marketplaces();
$sliders = $Envato->search('sliders');
$Envato->prettyPrint($sliders);

```

##### Limit results to a particular site...

[](#limit-results-to-a-particular-site)

```
$Envato = new Envato_marketplaces();
$sliders = $Envato->search('sliders', 'codecanyon');
$Envato->prettyPrint($sliders);

```

##### Limit further to a marketplace category...

[](#limit-further-to-a-marketplace-category)

```
$Envato = new Envato_marketplaces();
$sliders = $Envato->search('sliders', 'codecanyon', 'plugins');
$Envato->prettyPrint($sliders);

```

#### Get Account Balance

[](#get-account-balance)

```
require 'Envato_marketplaces.php';
$Envato = new Envato_marketplaces( 'YOUR_API_KEY');

# Echo out the balance.
echo $Envato->balance('your username');

```

#### Get Featured Item

[](#get-featured-item)

```
require 'Envato_marketplaces.php';
$Envato = new Envato_marketplaces();
$featured = $Envato->featured('codecanyon');

# Just for reviewing available props
$Envato->prettyPrint($featured);

# Featured author
echo $featured->featured_author->user;

# Featured file
echo $featured->featured_file->url;

#Free file
echo $featured->free_file->url;

```

#### Get Specific Item Details

[](#get-specific-item-details)

```
require 'Envato_marketplaces.php';
$Envato = new Envato_marketplaces();

# Pass in item id -- see url on item page on the marketplace.
$item = $Envato->item_details('232428');

# Only for development purposes. Review available options.
$Envato->prettyPrint($item);
?>
