Audio Conversion API
Convert audio between any of 23 supported formats — MP3, WAV, OGG, AAC, FLAC, M4A, WMA, OPUS, AIFF, AMR, AU, CAF, AC3, DTS, GSM, IRCAM, MP2, TTA, VOC, W64, WV, SPX, and RM. Like video, this is an async, submit-then-poll endpoint rather than one blocking request — same ffmpeg engine behind TransConvert's website converter.
curl -X POST \ .../api/v1/convert-async.php \ -H "Authorization: Bearer ..." \ -F "category=audio" \ -F "target=MP3" \ -F "file=@track.wav" # { "job_id": "job_...", "status": "queued" }
Video and audio conversions can run for minutes, too long to hold open a single synchronous request — these use a submit-then-poll flow instead of the endpoint above. Submit a file, get a job_id back right away, then poll for its status until it's done.
Submit a job
https://transconvert.com/api/v1/convert-async.php
| Field | Description |
|---|---|
Authorization | Required. "Bearer tc_live_...". |
category | Set to "audio". |
target | Required. Output format code: "MP3", "WAV", "OGG", "AAC", "FLAC", "M4A", "WMA", "OPUS", "AIFF", "AMR", "AU", "CAF", "AC3", "DTS", "GSM", "IRCAM", "MP2", "TTA", "VOC", "W64", "WV", "SPX", or "RM". |
file | Required. The audio file. |
curl -X POST \ https://transconvert.com/api/v1/convert-async.php \ -H "Authorization: Bearer tc_live_your_key_here" \ -F "category=audio" \ -F "target=MP3" \ -F "file=@track.wav" \ -o output.mp3
<?php $ch = curl_init('https://transconvert.com/api/v1/convert-async.php'); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => ['Authorization: Bearer tc_live_your_key_here'], CURLOPT_POSTFIELDS => [ 'category' => 'audio', 'target' => 'MP3', 'file' => new CURLFile('track.wav'), ], ]); $response = curl_exec($ch); $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); if ($status === 200) { file_put_contents('output.mp3', $response); } else { $error = json_decode($response, true); echo $error['error']['message']; }
const form = new FormData(); form.append('category', 'audio'); form.append('target', 'MP3'); form.append('file', new Blob([fs.readFileSync('track.wav')]), 'track.wav'); const res = await fetch('https://transconvert.com/api/v1/convert-async.php', { method: 'POST', headers: { Authorization: 'Bearer tc_live_your_key_here' }, body: form, }); if (res.ok) { fs.writeFileSync('output.mp3', Buffer.from(await res.arrayBuffer())); } else { const { error } = await res.json(); console.error(error.message); }
import requests with open('track.wav', 'rb') as f: response = requests.post( 'https://transconvert.com/api/v1/convert-async.php', headers={'Authorization': 'Bearer tc_live_your_key_here'}, data={'category': 'audio', 'target': 'MP3'}, files={'file': f}, ) if response.status_code == 200: with open('output.mp3', 'wb') as out: out.write(response.content) else: print(response.json()['error']['message'])
# gem install multipart-post require 'net/http' require 'net/http/post/multipart' url = URI('https://transconvert.com/api/v1/convert-async.php') File.open('track.wav') do |file| req = Net::HTTP::Post::Multipart.new url, 'category' => 'audio', 'target' => 'MP3', 'file' => UploadIO.new(file, 'application/octet-stream', 'track.wav') req['Authorization'] = 'Bearer tc_live_your_key_here' res = Net::HTTP.start(url.host, url.port, use_ssl: true) do |http| http.request(req) end if res.code == '200' File.write('output.mp3', res.body) else puts JSON.parse(res.body)['error']['message'] end end
// Gradle: implementation("com.squareup.okhttp3:okhttp:4.+") OkHttpClient client = new OkHttpClient(); RequestBody body = new MultipartBody.Builder() .setType(MultipartBody.FORM) .addFormDataPart("category", "audio") .addFormDataPart("target", "MP3") .addFormDataPart("file", "track.wav", RequestBody.create(new File("track.wav"), MediaType.parse("application/octet-stream"))) .build(); Request request = new Request.Builder() .url("https://transconvert.com/api/v1/convert-async.php") .header("Authorization", "Bearer tc_live_your_key_here") .post(body) .build(); try (Response response = client.newCall(request).execute()) { if (response.isSuccessful()) { Files.write(Paths.get("output.mp3"), response.body().bytes()); } else { System.err.println(response.body().string()); } }
Poll for status
Poll this every few seconds with the job_id you got back. "status" is one of queued, processing, completed, or failed.
https://transconvert.com/api/v1/job-status.php?job_id=job_...
curl -H "Authorization: Bearer tc_live_your_key_here" \ https://transconvert.com/api/v1/job-status.php?job_id=job_...
Download the result
Once status is "completed", the response includes a download_url — the same status URL with &download=1 appended. Requesting it then streams the converted file's raw bytes, same headers as every other endpoint on this page. The result is deleted the moment it's downloaded, or automatically after a short retention window if it's never downloaded.
scheduleJob results are deleted immediately after download, or automatically after a short retention window if never downloaded — download promptly.
Errors
Every failure returns a JSON error envelope with a "code" your code can branch on, plus a human-readable "message". Some errors include extra fields (quota_exceeded includes "limit" and "used", for example).
| Status & code | When it happens |
|---|---|
401 missing_key | No Authorization header was sent. |
401 invalid_key | The key doesn't exist, or has been revoked. |
403 account_suspended | The account owning this key is suspended. |
403 plan_required | The account is on the Free plan — API access needs Basic, Lite, Pro, or Team. |
400 invalid_category | "category" wasn't "image" or "document". |
400 invalid_target | "target" isn't a supported output format for that category. |
400 no_file | No file was sent, or the upload failed — the field must be named "file". |
413 file_too_large | The file exceeds your plan's max upload size. |
429 quota_exceeded | The plan's monthly conversion-minutes allowance is used up. Resets at the start of the next calendar month. |
429 concurrency_limit | Too many conversions already running at once for this account (shared with the website) — wait for one to finish and retry. |
404 job_not_found | No job with that id exists for this account (also returned for another account's job_id — its existence is never revealed). |
410 result_gone | The job completed, but its result has since been deleted (results are removed immediately after download, or automatically after a short retention window). |
400/415/422/500/503 conversion_failed | The file itself couldn't be converted — "message" explains why. The status code varies with the reason: 400/415/422 mean the file or target won't work no matter how many times you retry; 500/503 mean a server-side problem, and 503 specifically is worth a short retry. |
Supported formats
MP3, WAV, OGG, AAC, FLAC, M4A, WMA, OPUS, AIFF, AMR, AU, CAF, AC3, DTS, GSM, IRCAM, MP2, TTA, VOC, W64, WV, SPX, RM