The API for converting any file to OGG.
On the left you can see all available conversion options that you use as options section of the JSON.
Arguments |
|
---|---|
allow_multiple_outputs
Type: boolean Default: False |
If the conversion produces more than one output file, by default all of them are compressed in just one file. Set this option to true if you want a download link for each file. |
audio_bitrate
Type: integer Enum: 6 8 12 16 24 32 44 48 56 64 80 96 112 128 160 192 224 256 320 500 |
Audio bitrate in kbps. |
audio_codec
Type: string Enum: speex vorbis opus |
Sets the audio codec |
audio_vbr
Type: integer Enum: 64 80 96 112 128 160 192 224 256 320 500 |
If selected, a variable bitrate conversion is processed. The values are the average bitrate in kbit/s per stereo channel. Only working for vorbis. |
channels
Type: string Enum: stereo mono |
Audio channels. |
download_password
Type: string Pattern: ^[ -~]{0,1000}$ Example: secret_password |
A password to protect the download. To download the file send the password in the x-oc-download-password header or set a cookie named x-oc-download-password. The value contains a comma separated list of passwords. |
end
Type: string Pattern: ^\d\d:\d\d:\d\d$ |
Sets the end point of the part of the video you want to keep. The format is HH:MM:SS. HH = hour, MM = minutes, SS = seconds. Example 00:05:35 |
frequency
Type: integer Enum: 8000 11025 16000 22050 24000 32000 44100 48000 96000 |
Audio frequency in Hz. |
normalize
Type: boolean Default: False |
Normalize the audio volume. |
output_filename
Type: string Pattern: ^[\w\W]{0,255}$ Example: my_base_filename_without_extension |
The desired file name of the converted file WITHOUT the file extension. |
preset
Type: string Pattern: ^[\w\W]{1,255}$ |
Predefined options |
start
Type: string Pattern: ^\d\d:\d\d:\d\d$ |
Sets the start point of the part of the video you want to keep. The format is HH:MM:SS. HH = hour, MM = minutes, SS = seconds. Example 00:02:23 |
POST /v2/jobs HTTP/1.1
Host: https://api.api2convert.com
X-Oc-Api-Key: <your API key here>
Content-Type: application/json
{
"input": [{
"type": "remote",
"source": "https://example-files.online-convert.com/audio/mp3/example.mp3"
}],
"conversion": [{
"category": "audio",
"target": "ogg",
"options": {
<conversion options here>
}
}]
}