API Documentation 1.1
API Documentation 1.1
1. General and Setup For using the ConversionCloud you need a personal API Key. This key is valid up to a specific date and will allow you accessing the ConversionCloud. Moreover you get a personal login to the ConversionCloud Stats page. On this page you will see all running conversions, all occurred errors and some interesting stats and graphs. This login area is available at: http://conversioncloud.lunaweb.pro
2. Usage Our API is assessable via URL calls and it sends back XML or JSON answers. We recommend using SimpleXML for parsing it in PHP or using jQuery for parsing it with JavaScript. Of course we gladly help you implementing it. First API Call Starting Conversion Process
URL:
http://api.conversioncloud.lunaweb.pro/
PARAMETERS: &key Your Personal (secret) API Key &mediaurl The URL of the video/media. (youtube.com) &json (Optional) Send answer as JSON. Otherwise it will be XML &host (Optional) Your Host for Status/Download URLs. See Chap. 3 &ip (Optional) The Client IP for tracking
The conversion is now already started and you can get the status of the conversion by calling the Status-URL.
Getting the Status of the Conversion For calling the Status-URL you need can also add the &json parameter to get the answer in JSON format. It is possible to do the status request directly on client-side, because the &key parameter is not your secret key but another temporary key. While conversion is processing the answer will look like this:
<conversioncloud version="0.1"> <status step="download" percent="24">1.06 MB / 4.25 MB</status> <videoid>382782</videoid> <file>Hardwell - Cobra.mp3</file> <service>YouTube</service> <mediaurl>http://www.youtube.com/watch?v=2FUpxutpXVI</mediaurl> </conversioncloud>
We recommend calling the Status-URL till the conversion is finished or an error comes up. When conversion is finished, you will get an answer like this:
<conversioncloud version="0.1"> <status step="finished"/> <videoid>382782</videoid> <file>Hardwell - Cobra.mp3</file> <service>YouTube</service> <mediaurl>http://www.youtube.com/watch?v=2FUpxutpXVI</mediaurl> <downloadurl>http://srv13.conversioncloud.net/download/nN22e3KqnHiwZnFqn ZuVtKyi3mNrr2prmJiYbGthnmuwiaKc2tLQqGw=/</downloadurl> <filesize>1.64 MB</filesize> </conversioncloud>
The Download-URL will be the direct link to the converted MP3 file. Errors If errors come up, it will look like this. We recommend directly printing it out to the user.
<conversioncloud version="0.1"> <error>Invalid YouTube URL!</error> </conversioncloud>
srv11 IN srv12 IN srv13 IN srv14 IN srv15 IN srv16 IN srv17 IN srv18 IN srv19 IN srv20 IN srv21 IN srv22 IN srv23 IN srv24 IN srv25 IN srv26 IN srv27 IN srv28 IN
A A A A A A A A A A A A A A A A A A
91.121.123.59 94.23.227.164 94.23.249.208 188.165.251.133 37.59.3.184 188.165.192.43 188.165.232.167 188.165.208.185 176.31.125.112 188.165.224.74 188.165.205.10 188.165.209.119 91.121.222.217 91.121.222.220 91.121.222.222 91.121.222.223 94.23.13.160 94.23.13.173
Afterwards you can add the paremeter &host=yourservice.com to the first API call. 4. Contact & Help Feel free to contact us at info@lunaweb.de