Changes to /buyer/list-purchases Envato API endpoint.

/buyer/list-purchases API endpoint response size reduction

Since we introduced our new API gateway in January 2017, we’ve had a huge increase in the amount of requests we receive. It’s great to see so many people creating awesome API clients! With a large number of requests, comes a large amount of response traffic. Most of this traffic is in response to requests to the /buyer/list-purchases endpoint.

Talking with some of our theme and plugin creators, we established that most of the response we currently send is discarded as soon as it’s received. We don’t like waste! To address this, we’re making a change on Tuesday, 28 November 2017 that will see the fields that you’re not using dropped before we send them! The additional fields that we have been sending will be available to API clients who provide a “include_all_item_details” request parameter with the value of “true”. For more details, please refer to our API documentation.

We decided to adjust the default behaviour rather than releasing a new version in order to deliver this improvement to older clients who may never upgrade. There are many WordPress themes and plugins who are communicating with this older endpoint and may never upgrade to the newer endpoint. We wanted these older clients to receive these speed improvements, and changing the functionality of the existing endpoint allows us to do this.

We believe this change will provide a better user experience for both app creators and for your customers (increased speed, decreased bandwidth) and we’ll continue to monitor and improve the API experience.

Affected version: V3

Changes:

Default behaviour is altered, the API response now only returns a subset of item attributes, that is:

{
  id (integer):              // Item ID,
  name (string):             // Item name,
  number_of_sales (integer): // Number of sales,
  author_username (string):  // Author username,
  author_url (string):       // Author profile URL (e.g. https://themeforest.net/user/authorusername),
  author_image (string):     // Author avatar image URL,
  url (string):              // Item URL (e.g. https://themeforest.net/item/item-name/12345),
  rating (number):           // Average rating,
  updated_at (string):       // Date of last item update approval on Market,
  attributes (array[]):      // Item attributes,
  previews (array[]):        // Preview images and links,
  wordpress_theme_metadata (optional):  // Wordpress theme metadata,
  wordpress_plugin_metadata (optional): // Wordpress plugin metadata
}

The full original attributes can be queried against by providing include_all_item_details=true request parameter. For example the URL to query against would be: /buyer/list-purchases?include_all_item_details=true

Notes:

There would be no impact on applications that use attributes that are listed in the new subset item attributes, you would not have to change anything. If your applications do use attributes that are removed from default item attributes, please add include_all_item_details=true to your API request parameter to get all item attributes.

More details:

More details can be found in the API documentation here: https://build.envato.com/api/

2 Likes

@trung_le

while you are working on it, here are some another issues related to API

1. Auth Login => When using auth login, each time we need to approve sites? usually on twitter, only first time we need to approve, then it just redirect. Isn’t that possible with new API? the refresh token is not working I think.

2. Unwanted Item Info in API Calls : For some of the API calls, such as Author Sales which shows 50 recent sales. But inside that There’s full description of an item which is repeating for 50 items, This makes the API calls much slower.I think only the Item Name and Item ID is only need to include. (This is same for other API calls like Purchase code

If we get the Item ID, its easy for us to push another call to retrieve only that details right? It will be much faster I think.

https://api.envato.com/v3/market/author/sales

Same for purchase code: https://api.envato.com/v3/market/author/sale?code=

lot of unwanted info

These will definitely speedup response time

Hi there

Also, when you exchange a fresh token for a “permanent” one it will still not work to do further API calls after the 60 mins even if its offline token

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.