User Tools

Site Tools


Using the GetSimple Extend API

With the creation of GetSimple Extend comes a new API that allows developers the ability to grab vital statistics from your Extend profile and integrate them into your site or plugin. For example, A plugin developer can now code their plugin to look at our API and automatically determine if there is an update available or not.

API Syntax

Extend ID based call:

Replace ## with the ID of your plugin in our Extend repository. You can get your id by logging into Extend and viewing the particular file in question. This is the most 100% sure-fire way to identify your plugin because just as long as you do not delete your plugin from Extend, your ID will never change. Live example

Plugin Initial File based call: (plugins only)

Replace #####.php with the filename of your main plugin file. In order to use this call, your plugin needs to be packaged the correct way before uploaded into Extend. This will only work if your main-file is completely unique across all plugins within Extend. Try to name your main plugin file something completely unique. (This is the way that GS v3.1 checks to see if plugin updates are available.) Live example

API Result Set

The result set for either call above sends back a json encoded string that looks like this:

{"status":"successful","id":"112","filename_id":"translate.php","name":"Translate","version":"0.3","category":"Plugin","tags":"translation, languages, internationalization, i18n","tested_with":"2.03","updated_date":"March 25, 2011","support_url":"http:\/\/\/forum\/topic\/1610\/translation-plugin\/","author_url":"http:\/\/","owner":"mvlcek","path":"http:\/\/\/extend\/plugin\/translate\/112\/","file":"http:\/\/\/extend\/export\/2902\/112\/","downloads":"80","rating":""}

Since the result is in json format, you can turn the above into a PHP object array with json_decode($response). The resulting array will look like this:

stdClass Object
  [author_url] => http=>//
  [category] => Plugin
  [downloads] => 80
  [file] => http=>//
  [filename_id] => translate.php
  [id] => 112
  [name] => Translate
  [owner] => mvlcek
  [path] => http=>//
  [rating] => 4.8
  [status] => successful
  [support_url] => http=>//
  [tags] => translation, languages, internationalization, i18n
  [tested_with] => 2.03
  [updated_date] => March 25, 2011
  [version] => 0.3

PHP Example Code

This will echo out the latest version number for the live example above.

$my_plugin_id = 30; // replace this with yours
$apiback = file_get_contents(''.$my_plugin_id);
$response = json_decode($apiback);
if ($response->status == 'successful') {
	// Successful api response sent back. 
	$current_ver = $response->version;
echo $current_ver;

Extend API Limitations

This API is cached, and is allowed to be refreshed every 4 hours. This is to limit the server load for a service that does not need to be checked any more frequently than that. Please use this API responsibly.

plugins/extend_api.txt · Last modified: 2014/02/07 09:58 by datiswous