logo

API

Menu item

Downloads

API (application programming interface)

The interface description offers good insight into the possibilities of the integration of function calls of your own programs. Developers can easily manage the Premium and Collector Zone. This enables the creation of tools and programs with direct access to the RapidShare technology. What is more, the API is ideal to equip your own software with the RapidShare technology, and thereby making your programs for users even more attractive.
API

Upload script in Perl with Upload-Resume functionality

This script demonstrates the Upload with Resume on the RapidShare server. With the insight into procedural methods, you can easily generate your own scripts and programs.
Upload script

Optional parameters for RapidShare links

These parameters can influence the download behaviour of a file. This way you can control the access in more detail and insert RS-files into your own programs.

Referrer-string
You can add the referrer-string to the RapidShare URL so that our system can add the Premium RapidPoints to your account if the user bought a RapidShare account.
http://rapidshare.com/premium.html?ref=REFSTRING

Direct downloads for premium users
This parameter allows you to skip the interface, where you would have to choose how to download the file. If a premium user has not activated direct downloads in his settings, you can force him to directly download a file by marking it with this parameter.
http://rapidshare.com/files/12345/datei.name?directstart=1

Range functionality through a downloadlink
This parameter enables you to transmit a range-request without the corresponding HTTP header. The value must be entered in bytes. This allows you to receive only a part of a download. This gives you the possibility to create a simple download manager on your own or to develop pseudo streaming solutions.
http://rapidshare.com/files/12345/datei.name?start=123
http://rapidshare.com/files/12345/datei.name?start=0-12345

  • One value (bytes) delivers you everything from this point on. Startvalue is 0. Two values seperated by a "-" act as start and stop values. 100-150 delivers exactly 50 bytes after byte-position 100.
  • FLV has one special ability; if the start value is larger than 0, we include the FLV header. This way you can implement pseudo streaming in Flash.

Secure TrafficShare

Change the relevant file into a secured TrafficShare file in your Premium Zone.
Create the download link as shown in the examples.
When calculating the expiry date, please note that in all cases our server time has to be used. You can see the current server time in the Premium Zone. If your local time is different, the programer has to take it into consideration and make the adjustments.

Example of a code in PERL for the creation of a secure TrafficShare link:
{23}
                  
#!/usr/bin/perl
use strict;
use warnings;
use Digest::MD5("md5_hex");

my $premiumaccount = "12345";     # Insert Premium Account ID
my $fileid = "12345678";          # Insert File ID
my $filename = "yourfile.zip";    # Insert file name
my $killcode = "123456789012345"; # File Killcode. The Killcode can be viewed in the Premium Zone under "Export Details"
my $validuntil = time + 300;      # Effective for 300 seconds from now on
my $md5hex = md5_hex("$premiumaccount,$fileid,$killcode,$validuntil");

print "Secured link is: http://rapidshare.com/files/$fileid/t$validuntil-$md5hex/$filename";
				
Example of a code in PHP for the creation of a secure TrafficShare link:
{23}
<?
$premiumaccount = "12345";     // Insert Premium Account ID
$fileid = "12345678";          // Insert File ID
$filename = "yourfile.zip";    // Insert file name
$killcode = "123456789012345"; // File Killcode. The Killcode can be viewed in the Premium Zone under "Export Details"
$validuntil = time() + 300;    // Effective for 300 seconds from now on
$md5hex = md5($premiumaccount.",".$fileid.",".$killcode.",".$validuntil);

print "Secured link is: http://rapidshare.com/files/$fileid/t$validuntil-$md5hex/$filename";
?>                           
                

Your program code should not be visible to others. For instance, a download link that is valid for 3 years could be created or the file could be deleted because the "Killcode" is included. If you offer the facility to generate download links on your website, you should under no circumstances program the process in JavaScript or any other client-side scripting language.
The expiry date is calculated on our server. Thus the expiry date has to be based on the server time of RapidShare.
The current server time can be seen in the Premium Zone under "Overview".
Adjust the calculation of the time by adding or subtracting the difference between your local time and our server time.