Documentation
Prerequisites
In order to use our API, you will need to get an access-code which you should send along with every api request (see Main Page for more information). You can get an api key by simply
logging in, and you will see it appear automatically below (if you return here), and in the api key box on the API Demo page.
You will then see your generated api code, which you should use to authorise yourself against our system, whenever making requests.
API Requests
Link Generation
In order to generate links, you should send a POST OR GET request to http://api.rapidgen.net/api/. Only send ONE type request; if you send POST, the url should ONLY be 'http://api.rapidgen.net/api/'!). The following postdata is expected:
- api_key: <your api key> [Log In to have your API Key automagically appear here]
- links: <a comma-separated (,) or line-break-separated (\r\n) list of your link(s)>
- urlencoded parameters are required if making a POST
For a demonstration, you can use the following API key:
BKAy7UlBOhT92oFFC5r9YYsMMFTOqR @ the
API Demo
API Link Generation Example
<REQUEST> (using POST)
POST /api/ HTTP/1.1
Host: api.rapidgen.net
User-Agent: Mozilla/5.0 (Windows NT 5.2; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate*
Accept-Charset: UTF-8,*
Content-Type: application/x-www-form-urlencoded
Content-Length: 447
sub=linkgen&links=http%3A%2F%2Ffilehost.com%2Fdl%2F43686851%2Fd2bc528%2FCash.2008.x264.utkuemre.part1.rar.html+%0D%0Ahttp%3A%2F%2Ffilehost.com%2Fdl%2F43686914%2F89b6b78%2FCash.2008.x264.utkuemre.part2.rar.html+%0D%0Ahttp%3A%2F%2Ffilehost.com%2Fdl%2F43686954%2F17b2bb0%2FCash.2008.x264.utkuemre.part3.rar.html+%0D%0Ahttp%3A%2F%2Ffilehost.com%2Fdl%2F43686969%2F8ac988b%2FCash.2008.x264.utkuemre.part4.rar.html&api_key=BKAy7UlBOhT92oFFC5r9YYsMMFTOqR
<RESPONSE>
HTTP/1.1 200 OK
Date: Sat, 15 Jan 2011 21:18:13 GMT
Server: Apache
Vary: Host,Accept-Encoding
X-Powered-By: PHP
Cache-Control: no-cache, must-revalidate
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Content-Length: 356
Content-Type: application/json; charset=UTF-8
{"status":"OK","data":[{"service":"filehost","sid":"alcva","filename":"video.x264.part1.rar"},{"service":"filehost","sid":"AApCR","filename":"video.x264.part2.rar"},{"service":"filehost","sid":"SG6E1","filename":"video.x264.part3.rar"},{"service":"filehost","sid":"hu4Ue","filename":"video.x264.part4.rar"}]}
You could also have made the request directly via the url:
<REQUEST> (using GET)
http://api.rapidgen.net/api/?sub=linkgen&links=http://filehost.com/file/43686851/d2bc528/video.x264.part1.rar.html,http://filehost.com/file/43686914/89b6b78/video.x264.part2.rar.html,http://filehost.com/file/43686954/17b2bb0/video.x264.part3.rar.html,http://filehost.com/file/43686969/8ac988b/video.x264.part4.rar.html&api_key=BKAy7UlBOhT92oFFC5r9YYsMMFTOqR
*If you send this header in the <REQUEST>, you will receive a gzipped response from us. The header is optional, so if you exclude it, you will get a normal unzipped response.
Subroutine List
You can pass several parameters to the /api/ uri to get back a result. You can either use POST, or GET — simply by passing the parameters in the full url appended with & as follows:
http://api.rapidgen.net/api/?api_key=api_key&sub=sub
Notice the appendage of /api/ to the query, followed by your parameters. The parameter api_key must always be passed if you want a result set based on your own files. (Parameters which do not require the api_key parameter may be added later.)
The subroutine sub will be one of the following:
getlinklist_all
Returns a json-encoded list of all your stored links.
getlinklist_active
Returns a json-encoded list of all your active stored links. Inactive (expired) links will not be returned in the list.
getlinklist_inactive
Returns a json-encoded list of all your expired stored links. Active (downloadable) links will not be returned in the list.
getbw_used
Parameter(s) required:
Returns json-encoded data of your used bandwidth for a given filehost
getbw_remain
Parameter(s) required:
Returns json-encoded data of your remaining bandwidth for a given filehost
Parameters List
Parameters are not always required. You only need to use them if they are required by one of the subroutines above. The method for passing the parameters is the same as the subroutines; passed directly via the url, i.e. &filehost=<filehost> or along with other parameters in a POST request.
The subroutine sub could be one of the following:
filehost
The name for the particular filehost you want to find statistics for. The filehost name should be in all lower case letters. See the statistics table at the bottom of any page of http://rapidgen.net for a list of the filehost names (called 'Service*'). Example: &filehost=megaupload
API Error Codes
Here's a quick list of some of the error codes you're likely to get back from the API. You're only going to get an error code in the event of an error, not when you get a valid response back.
- 100 No valid subroutine specified. Halted.
- 101 Incorrect or non-existing API key provided
- 102 Your usergroup is not allowed to access this API
- 103 Your API access has expired, you will need to renew your access
- 104 No active links found
- 105 No inactive links found
- 106 No links found
- 107 Valid filehost parameter not passed
- 108 Used Bandwidth could not be calculated
- 109 Remaining Bandwidth failed to calculate
- 200 No privileges
- 201 Invalid login method
- 202 Invalid request method (GET and POST not allowed simultaneously)
- 300 No links posted
- 301 No links found
- 302 Please convert maximum of [NUMBER] links at once, thanks!
- 303 [LINK] Invalid link format
- 304 You do not have ability/authorisation to generate links at this time!
- 305 Unknown db insert error, please report error to support!
- 306 Link password update failed
- 307 Sorry, you don\'t have rights to perform this operation.
- 308 No links to process!
- 309 [LINK] not found - perhaps it was removed?
- 310 No direct video link id found!
- 311 SSH Login Failed
- 312 [LINK] [MESSAGE]
- 313 [LINK] not available/not found!
- 314 [LINK] filename not found!
- 315 [LINK] filesize not found!
- 316 [LINK] could not be processed. Perhaps generating a smaller number of links at the same time should work. If this error is persistent, please contact a member of staff.
- 317 [LINK] requires a password!
- 318 Megaupload direct-link not found!
- 319 Temporary IP Block Detected. Please wait 2 mins and try again!
- 320 The file you are trying to access is temporarily unavailable!
- 321 [LINK] returned 503 Service Temporarily Unavailable
- 322 Link password update failed
- 323 Failed to generate from Safelink
- 324 Safelink direct link not found!
- 325 [LINK] Link is not valid for generation - please remove the associated Safelink!
- 326 There are no [SERVICE] accounts available!
- 327 Daily [SERVICE] Limit ([B/W]) Reached. Please wait until some time until bandwidth frees up! (Remove your [SERVICE] links from the generation box)
- 328 Sorry, the total [SERVICE] download amount ([B/W]) is greater than what you have left on your account download limit. Please remove some of the links making sure the sumtotal of the filesizes does not exceed your limits!
- 404 Page not found!