- Softonic >
Softonic API
-
Softonic API
-
Resources
-
API Methods
- testEcho
Api
- getHotSoftware
- getHomeChoice
Latest
- getPlatforms
- getChildren
- getParents
- getPrograms
Section
- getInfo
- getRelated
- getScreenshots
- getOpinions
- getOpinion
- getFans
- getVideos
- getDownloadHistory
- getFreeDownloadUrl
Program
- Search
Search
How to use the Softonic API
This short “how-to” guide was created specifically for developers who are in charge of developing the software channel. In it, you’ll be able to find the main functionalities and API methods, that will allow you to get data from Softonic so you can show software and our editor’s content on your own site. We offer you the main topics from our site and include the corresponding code.*
We want to make it easy for you to create your own software channel with the Softonic API. For feedback or suggestions please feel free to send us an email to: cobranding@Softonic.com.
* Please note that we have inserted on the code some explanatory comments.
- Bread crumb navigation
- Buy link
- Category list
- Platform menu bar
- Software page
- Software review
- Mobile brand list
- Mobile OS list
- Mobile devices list
- Search results
- Sub category list
- Top weekly downloads
- Hot software list
- Top rated
- Top updated
Bread crumb navigation:
Back to listThis is a very useful navigation aid for user interfaces, allowing your users to keep track of where they are located within your website. The bread crumb navigation will show platform, categories, and subcategories so that user can find their way back to the beginning.
Show/Hide Code
<?php
// Title: A bread crumb navigation.
$data = array(
'api_key' => '26752785855dbed5ee5a5cbacd20b4fd', // Replace this by your API key.
'language' => 'en', //Desired language response.
'id_program' => 7595, // Program id..
);
$result = getProgramInfo( $data );
echo "<h1>Bread Crumbs for ".$result['program']['title']."</h1>";
foreach( $result['program']['section_path'] as $section )
{
echo " <a href='".$section['section']['url']."'>".$section['section']['name']."</a> »";
}
/**
* Gets the top download programs for a given category.
*/
function getProgramInfo( $data )
{
$url = "http://api2.softonic.com/".$data['language']."/program_getInfo/".$data['id_program'].".php?key=".$data['api_key'];
return unserialize( file_get_contents( $url ) );
}
?>
Buy link.
Back to listThis will show a link that will allow your users to buy software. Including the buy link is optional. We collaborate with Digital River and are able to deliver their buy button in case there is a buy option with a specific software product. The user will shop the product with one of Digital River’s e-shopping carts.
Show/Hide Code
<?php
// Title: A buy link.
$data = array(
'api_key' => '26752785855dbed5ee5a5cbacd20b4fd', // Replace this by your API key.
'language' => 'en', //Desired language response.
'id_program' => 116955, // Program id..
);
$result = getProgramInfo( $data );
if( isset( $result['program']['partner_esales'] ) && !is_null( $result['program']['partner_esales'] ) )
{
echo "<a href='".$result['program']['partner_esales']['url']."'>Buy ".$result['program']['title']."</a> ".$result['program']['partner_esales']['price_with_discount']." ".$result['program']['partner_esales']['currency'];
}
else
{
echo "No esales available for ".$result['program']['title'];
}
/**
* Gets the top download programs for a given category.
*/
function getProgramInfo( $data )
{
$url = "http://api2.softonic.com/".$data['language']."/program_getInfo/".$data['id_program'].".php?key=".$data['api_key'];
return unserialize( file_get_contents( $url ) );
}
?>
Category list.
Back to listThis will show a list of our different software categories on your website. Every platform (Windows, Mac, Phones, etc) has categories like internet, games, security, (to name a few) and will help users to better browse the content. To get a complete picture of the existing categories please visit Softonic.com. We strongly suggest you consider including sub categories to your content.
Show/Hide Code
<?php
// Title: A category list.
$data = array(
'api_key' => '26752785855dbed5ee5a5cbacd20b4fd', // Replace this by your API key.
'language' => 'en', //Desired language response.
'id_section' => 2,
);
$sections = getCategories( $data );
$html_output = parseResult( $sections );
echo $html_output;
function getPlatforms( $data )
{
if( empty( $id_platform ) )
{
$id_platform = $data['id_platform'];
}
// Build API url.
$url = "http://api2.softonic.com/". $data['language'] ."/section_getPlatforms/". $data['id_section'] .".php?key=". $data['api_key'];
// Return platforms.
return unserialize( file_get_contents( $url ) );
}
function getCategories( $data )
{
// Build API url.
$url = "http://api2.softonic.com/". $data['language'] ."/section_getChildren/". $data['id_section'] .".php?key=". $data['api_key'];
// Return platforms.
return unserialize( file_get_contents( $url ) );
}
/**
* Function to make up all the resuls into a nice HTML output, tune it to fit your needs.
*/
function parseResult( $result )
{
$output = "<ul>";
foreach ( $result['sections'] as $platform)
{
$output .= "<li><a href='".$platform['section']['url']."'>".$platform['section']['name']."</a></li>";
}
$output .= "</ul>";
return $output;
}
?>
Platform menu bar
Back to listThis will show a menu bar containing the different software platforms available on Softonic site directly on your website. Currently we offer the platforms Windows, Mac, Phones, Web Apps, Palm Os, Pocket PC and Linux (only for the Spanish site).
Show/Hide Code
<?php
// Title: A channels menu bar.
$data = array(
'api_key' => '26752785855dbed5ee5a5cbacd20b4fd', // Replace this by your API key.
'language' => 'en', //Desired language response.
'id_section' => 1,
);
$sections = getCategories( $data );
$html_output = parseResult( $sections );
echo $html_output;
function getPlatforms( $data )
{
if( empty( $id_platform ) )
{
$id_platform = $data['id_platform'];
}
// Build API url.
$url = "http://api2.softonic.com/". $data['language'] ."/section_getPlatforms/". $data['id_section'] .".php?key=". $data['api_key'];
// Return platforms.
return unserialize( file_get_contents( $url ) );
}
function getCategories( $data )
{
// Build API url.
$url = "http://api2.softonic.com/". $data['language'] ."/section_getChildren/". $data['id_section'] .".php?key=". $data['api_key'];
// Return platforms.
return unserialize( file_get_contents( $url ) );
}
/**
* Function to make up all the resuls into a nice HTML output, tune it to fit your needs.
*/
function parseResult( $result )
{
$output = "<ul>";
foreach ( $result['sections'] as $platform)
{
$output .= "<li><a href='".$platform['section']['url']."'>".$platform['section']['name']."</a></li>";
}
$output .= "</ul>";
return $output;
}
?>
Software page
Back to listThe software page is the page were the user gets all information regarding a software product. This page will show the main information such as key features and system requirements for the user to see about the software they’re about to download. Please note that we treat the software review separately.
Show/Hide Code
<?php
// Title: A program page.
$data = array(
'api_key' => '26752785855dbed5ee5a5cbacd20b4fd', // Replace this by your API key.
'language' => 'en', //Desired language response.
'id_program' => 7595, // Program id..
);
$result = getProgramInfo( $data );
$html_output = parseResult( $result );
echo $html_output;
/**
* Gets the top download programs for a given category.
*/
function getProgramInfo( $data )
{
$url = "http://api2.softonic.com/".$data['language']."/program_getInfo/".$data['id_program'].".php?key=".$data['api_key'];
return unserialize( file_get_contents( $url ) );
}
/**
* Function to make up all the resuls into a nice HTML output, tune it to fit your needs.
*/
function parseResult( $result )
{
$output = "<h1>".$result['program']['title']." Details</h1>";
$output .= "<img src='".$result['program']['img']."' />";
$output .= "<p>".$result['program']['short_description']."</p>";
$output .= "<ul>";
// Build bread crumb.
$output .= "<li>Bread Crumbs:";
foreach( $result['program']['section_path'] as $section )
{
$output.= " <a href='".$section['section']['url']."'>".$section['section']['name']."</a> »";
}
$output .= "</li>";
$output .= "<li>Version: ".$result['program']['version']."</li>";
$output .= "<li>Size: ".$result['program']['size']."</li>";
$output .= "<li>License: ".$result['program']['license']."</li>";
$output .= "<li>Date Added: ".$result['program']['date_added']."</li>";
$output .= "<li>#Downloads: ".$result['program']['num_downloads']."</li>";
$output .= "<li>URL Download: <a href='".$result['program']['url_download']."'>".$result['program']['url_download']."</a></li>";
$output .= "<li>Rating Softonic: ".$result['program']['rating_softonic']."</li>";
$output .= "<li>Rating User: ".$result['program']['rating_user']."</li>";
$output .= "<li>Rating Usability: ".$result['program']['rating_usability']."</li>";
$output .= "<li>Rating Stability: ".$result['program']['rating_stability']."</li>";
$output .= "<li>Rating Installation: ".$result['program']['rating_installation']."</li>";
$output .= "<li>Rating Functionality: ".$result['program']['rating_functionality']."</li>";
$output .= "<li>Rating Appearance: ".$result['program']['rating_appearance']."</li>";
// List the pros.
$output .= "<li>Pros:<ul>";
foreach( $result['program']['pros'] as $pro )
{
$output.= "<li>".$pro."</li>";
}
$output .= "</ul></li>";
// List the cons.
$output .= "<li>Cons:<ul>";
foreach( $result['program']['cons'] as $pro )
{
$output.= "<li>".$pro."</li>";
}
$output .= "</ul></li>";
// List OS compatibles.
$output .= "<li>Compatible with:<ul>";
foreach( $result['program']['compatible'] as $os )
{
$output.= "<li>".$os['os']['name']."</li>";
}
$output .= "</ul></li>";
// List availability in other Softonic instances.
$output .= "<li>Also available in:<ul>";
foreach( $result['program']['other_instances'] as $instance )
{
$output.= "<li><a href='".$instance['instance']['url']."'>".$instance['instance']['instance']."</a></li>";
}
$output .= "</ul></li>";
$output .= "</ul>";
return $output;
}
?>
Software review
Back to listThe software review is the main component of the software page. The following code will show the review made by our editors on the software your users are about to download. Please note that the remaining information on the software page is treated separately.
Show/Hide Code
<?php
// Title: A program's review.
$data = array(
'api_key' => '26752785855dbed5ee5a5cbacd20b4fd', // Replace this by your API key.
'language' => 'en', //Desired language response.
'id_program' => 7595, // Program id..
);
$result = getProgramInfo( $data );
$html_output = parseResult( $result );
echo $html_output;
/**
* Gets the top download programs for a given category.
*/
function getProgramInfo( $data )
{
$url = "http://api2.softonic.com/".$data['language']."/program_getInfo/".$data['id_program'].".php?key=".$data['api_key'];
return unserialize( file_get_contents( $url ) );
}
/**
* Function to make up all the resuls into a nice HTML output, tune it to fit your needs.
*/
function parseResult( $result )
{
$output = "<h1>Softonic review for ".$result['program']['title']."</h1>";
$output .= "<span>". $result['program']['review'] ."</span>";
return $output;
}
?>
Mobile brands list.
Back to listThe mobile platform requires a special treatment. Users will want to choose mobile brand, mobile device and mobile operating system to find the software product that’s right for them. The following code will show a list for mobile brands (Apple, Blackberry, HTC, Nokia, Samsung, etc.) on your website.
Show/Hide Code
<?php
// Title: A mobile brands list.
$data = array(
'api_key' => '26752785855dbed5ee5a5cbacd20b4fd', // Replace this by your API key.
'language' => 'en', //Desired language response.
'id_brand' => 42, // Apple.
);
$result = getMobileBrands( $data );
echo "<select name='mobile_brands'>";
echo "<option value=''>Select your brand...</option>";
foreach( $result['brands'] as $brands )
{
echo "<option value='".$brands['brand']['id_brand']."'>".$brands['brand']['name']."</option>";
}
echo "</select>";
/**
* Gets the top download programs for a given category.
*/
function getMobileBrands( $data )
{
$url = "http://api2.softonic.com/".$data['language']."/mobile_getBrands.php?key=".$data['api_key'];
return unserialize( file_get_contents( $url ) );
}
?>
Mobile OS list
Back to listThe mobile platform requires a special treatment. Users will want to choose mobile brand, mobile device and mobile operating system to find the software product that’s right for them. The following code will show a list for mobile operating systems (Android, iOS, Java, Symbian, Windows Mobile, etc.) on your website.
Show/Hide Code
<?php
// Title: A mobile OS list.
$data = array(
'api_key' => '26752785855dbed5ee5a5cbacd20b4fd', // Replace this by your API key.
'language' => 'en', //Desired language response.
);
$result = getMobileOs( $data );
echo "<select name='mobile_os'>";
echo "<option value=''>Select your mobile OS...</option>";
foreach( $result['oss'] as $os )
{
echo "<option value='".$os['os']['id_os']."'>".$os['os']['name']."</option>";
}
echo "</select>";
/**
* Gets the top download programs for a given category.
*/
function getMobileOs( $data )
{
$url = "http://api2.softonic.com/".$data['language']."/mobile_getOs.php?key=".$data['api_key'];
return unserialize( file_get_contents( $url ) );
}
?>
Mobile devices list.
Back to listThe mobile platform requires a special treatment. Users will want to choose mobile brand, mobile device and mobile operating system to find the software product that’s right for them. The following code will show a list with the most popular mobile devices on your website.
Show/Hide Code
<?php
// Title: A mobile devices list.
$data = array(
'api_key' => '26752785855dbed5ee5a5cbacd20b4fd', // Replace this by your API key.
'language' => 'en', //Desired language response.
'id_brand' => 42, // Apple.
);
$result = getMobileDevices( $data );
echo "<select name='mobile_devices'>";
echo "<option value=''>Select your device...</option>";
foreach( $result['phones'] as $phones )
{
echo "<option value='".$phones['phone']['id_phone']."'>".$phones['phone']['name']."</option>";
}
echo "</select>";
/**
* Gets the top download programs for a given category.
*/
function getMobileDevices( $data )
{
$url = "http://api2.softonic.com/".$data['language']."/mobile_getPhones/".$data['id_brand'].".php?key=".$data['api_key'];
return unserialize( file_get_contents( $url ) );
}
?>
Search result
Back to listPeople either search or browse for software products. You will want to offer a search and a corresponding search result page. This code will show the most popular search results for searches done by your users on your website.
Show/Hide Code
<?php
// Title: A search result.
// Parameters to build Softonic search URL.
$data = array(
'query' => 'mp3', // Query word.
'instance' => 'http://en.softonic.com/s/', // Url to perform Softonic search.
'output' => 'php', // Output format ( It will work too with: "json" and "xml" formats),
);
// Build desired search URL.
$url_search = $data['instance'] . $data['query'] . "/". $data['output'];
// Launch search.
$result = unserialize( file_get_contents( $url_search ) );
// Parse result to a nice HTML output.
$html_output = parseResult( $result, $data );
echo $html_output;
/**
* Function to make up all the resuls into a nice HTML output, tune it to fit your needs.
*/
function parseResult( $result, $data )
{
$output = "<p>" . $result['total_search_results'] ." programs found for ". $data['query'] ."</p>";
$output .= "<ul>";
foreach( $result['programs'] as $program )
{
$output .= "<li><img src='".$program['url_thumbnail']."' /> <a href='".$program['url_download']."'>". $program['name']."</a> Rating: ".$program['softonic_rating']."</li>";
}
$output .= "</ul>";
return $output;
}
?>
Sub categories list
Back to listEach category has sub categories. This list is much more detailed than the general category list and makes it easier to access specific software and helps users browse the content. This code will show a list of our software sub categories on your website.
Show/Hide Code
<?php
// Title: A sub Categories list.
$data = array(
'api_key' => '26752785855dbed5ee5a5cbacd20b4fd', // Replace this by your API key.
'language' => 'en', //Desired language response.
'id_section' => 2,
);
$sections = getCategories( $data );
$html_output = parseResult( $sections );
echo $html_output;
function getPlatforms( $data )
{
if( empty( $id_platform ) )
{
$id_platform = $data['id_platform'];
}
// Build API url.
$url = "http://api2.softonic.com/". $data['language'] ."/section_getPlatforms/". $data['id_section'] .".php?key=". $data['api_key'];
// Return platforms.
return unserialize( file_get_contents( $url ) );
}
function getCategories( $data )
{
// Build API url.
$url = "http://api2.softonic.com/". $data['language'] ."/section_getChildren/". $data['id_section'] .".php?key=". $data['api_key'];
// Return platforms.
return unserialize( file_get_contents( $url ) );
}
/**
* Function to make up all the resuls into a nice HTML output, tune it to fit your needs.
*/
function parseResult( $result )
{
$output = "<h1>Windows</h1>";
$output .= "<ul>";
foreach ( $result['sections'] as $platform)
{
$output .= "<li><a href='".$platform['section']['url']."'>".$platform['section']['name']."</a></li>";
}
$output .= "</ul>";
return $output;
}
?>
Top weekly downloads
Back to listUsers either search or browse the content. For a better browsing experience top lists should be included in the content. The top weekly download list will show a list on your website of the most downloaded software each week from Softonic.
Show/Hide Code
<?php
// Title: A top downloads programs list (weekly)
$data = array(
'api_key' => '26752785855dbed5ee5a5cbacd20b4fd', // Replace this by your API key.
'language' => 'en', //Desired language response.
'id_platform' => 2, // Windows category.
);
$result = getTopDownloads( $data );
$html_output = parseResult( $result );
echo $html_output;
/**
* Gets the top download programs for a given category.
*/
function getTopDownloads( $data )
{
$url = "http://api2.softonic.com/".$data['language']."/section_getPrograms/".$data['id_platform'].".php?key=".$data['api_key']."&order=weekly";
return unserialize( file_get_contents( $url ) );
}
/**
* Function to make up all the resuls into a nice HTML output, tune it to fit your needs.
*/
function parseResult( $result )
{
$output = "<h1>Top Downloaded Software for Windows</h1>";
$output .= "<ul>";
foreach( $result['programs'] as $program )
{
$output .= "<li><img src='".$program['program']['img']."' /> <a href='".$program['program']['url']."'>". $program['program']['title']."</a></li>";
}
$output .= "</ul>";
return $output;
}
?>
Hot software list
Back to listUsers either search or browse the content. For a better browsing experience top lists should be included in the content. The “hot software list” will show a list of the hottest software based on Softonic editor’s evaluations on your website.
Show/Hide Code
<?php
// Title: A top popular programs list.
$data = array(
'api_key' => '26752785855dbed5ee5a5cbacd20b4fd', // Replace this by your API key.
'language' => 'en', //Desired language response.
'id_platform' => 2, // Windows category.
);
$result = getTopPopular( $data );
$html_output = parseResult( $result );
echo $html_output;
/**
* Gets the top download programs for a given category.
*/
function getTopPopular( $data )
{
$url = "http://api2.softonic.com/".$data['language']."/latest_getHotSoftware/".$data['id_platform'].".php?key=".$data['api_key'];
return unserialize( file_get_contents( $url ) );
}
/**
* Function to make up all the resuls into a nice HTML output, tune it to fit your needs.
*/
function parseResult( $result )
{
$output = "<h1>Popular Software for Windows</h1>";
$output .= "<ul>";
foreach( $result['programs'] as $program )
{
$output .= "<li><img src='".$program['program']['img']."' /> <a href='".$program['program']['url']."'>". $program['program']['title']."</a></li>";
}
$output .= "</ul>";
return $output;
}
?>
Top rated
Back to listUsers either search or browse the content. For a better browsing experience top lists should be included in the content. The “top rated list” will show a list of the best rated software by Softonic users on your website.
Show/Hide Code
<?php
// Title: A top rated programs list.
$data = array(
'api_key' => '26752785855dbed5ee5a5cbacd20b4fd', // Replace this by your API key.
'language' => 'en', //Desired language response.
'id_platform' => 2, // Windows category.
);
$result = getTopRated( $data );
$html_output = parseResult( $result );
echo $html_output;
/**
* Gets the top download programs for a given category.
*/
function getTopRated( $data )
{
$url = "http://api2.softonic.com/".$data['language']."/section_getPrograms/".$data['id_platform'].".php?key=".$data['api_key']."&order=rating";
return unserialize( file_get_contents( $url ) );
}
/**
* Function to make up all the resuls into a nice HTML output, tune it to fit your needs.
*/
function parseResult( $result )
{
$output = "<h1>Top Rated Software for Windows</h1>";
$output .= "<ul>";
foreach( $result['programs'] as $program )
{
$output .= "<li><img src='".$program['program']['img']."' /> <a href='".$program['program']['url']."'>". $program['program']['title']."</a></li>";
}
$output .= "</ul>";
return $output;
}
?>
Top updated
Back to listUsers either search or browse the content. For a better browsing experience top lists should be included in the content. The “top updated list” will show a list of the most recently updated software on Softonic on your website.
Show/Hide Code
<?php
// Title: A top updated programs list.
$data = array(
'api_key' => '26752785855dbed5ee5a5cbacd20b4fd', // Replace this by your API key.
'language' => 'en', //Desired language response.
'id_platform' => 2, // Windows category.
);
$result = getTopUpdated( $data );
$html_output = parseResult( $result );
echo $html_output;
/**
* Gets the top download programs for a given category.
*/
function getTopUpdated( $data )
{
$url = "http://api2.softonic.com/".$data['language']."/section_getPrograms/".$data['id_platform'].".php?key=".$data['api_key']."&order=date";
return unserialize( file_get_contents( $url ) );
}
/**
* Function to make up all the resuls into a nice HTML output, tune it to fit your needs.
*/
function parseResult( $result )
{
$output = "<h1>Top Updated Software for Windows</h1>";
$output .= "<ul>";
foreach( $result['programs'] as $program )
{
$output .= "<li><img src='".$program['program']['img']."' /> <a href='".$program['program']['url']."'>". $program['program']['title']."</a></li>";
}
$output .= "</ul>";
return $output;
}
?>
Copyright Softonic © 2009-2012 - All rights reserved
Softonic