Starts an asynchronous job to identify the most probable language in the audio. Audio can be specified in two ways, either by including a public url to the media via the source_config
option or by uploading a local file as part of a multipart/form request.
Language Identification Job Options
Language Identification Job Details
Bad Request
Request Unauthorized
Payload Too Large
{- "metadata": "sample user provided metadata",
- "notification_config": {
- "auth_headers": {
- "Authorization": "Bearer <notification-url-token>"
}
}, - "delete_after_seconds": 1000000,
- "source_config": {
- "auth_headers": {
- "Authorization": "Bearer <source-url-token>"
}
}
}
{- "id": "Umx5c6F7pH7r",
- "status": "in_progress",
- "created_on": "2018-05-05T23:23:22.29Z",
- "type": "language_id"
}
Gets a list of language identification jobs submitted within the last 30 days in reverse chronological order up to the provided limit
number of jobs per call. Note: Jobs older than 30 days will not be listed. Pagination is supported via passing the last job id
from a previous call into starting_after
.
List of Rev AI Language Identification Jobs
Bad Request
Request Unauthorized
/** * Requires libcurl */ $query = array( "limit" => "100", "starting_after" => "string" ); $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_HTTPHEADER => [ "Authorization: Bearer <YOUR_TOKEN_HERE>" ], CURLOPT_URL => "https://api.rev.ai/languageid/v1/jobs?" . http_build_query($query), CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "GET", ]); $response = curl_exec($curl); $error = curl_error($curl); curl_close($curl); if ($error) { echo "cURL Error #:" . $error; } else { echo $response; }
[- {
- "id": "Bmx5c8F5pH7a",
- "status": "in_progress",
- "created_on": "2018-05-05T23:23:22.29Z",
- "type": "language_id"
}, - {
- "id": "6BxQYGa638Yt",
- "status": "completed",
- "created_on": "2018-05-05T23:23:22.29Z",
- "completed_on": "2018-05-05T23:45:13.41Z",
- "type": "language_id"
}
]
Returns information about a language identification job.
Language Identification Job Details
Request Unauthorized
Job Not Found
/** * Requires libcurl */ const id = "YOUR_id_PARAMETER"; $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_HTTPHEADER => [ "Authorization: Bearer <YOUR_TOKEN_HERE>" ], CURLOPT_URL => "https://api.rev.ai/languageid/v1/jobs/" . id, CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "GET", ]); $response = curl_exec($curl); $error = curl_error($curl); curl_close($curl); if ($error) { echo "cURL Error #:" . $error; } else { echo $response; }
{- "id": "Umx5c6F7pH7r",
- "status": "in_progress",
- "created_on": "2018-05-05T23:23:22.29Z",
- "type": "language_id"
}
Deletes a language identification job. All data related to the job will be permanently deleted. A job can only be deleted once it's completed (either with success or failure).
Job was successfully deleted
Request Unauthorized
Job Not Found
Conflict
/** * Requires libcurl */ const id = "YOUR_id_PARAMETER"; $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_HTTPHEADER => [ "Authorization: Bearer <YOUR_TOKEN_HERE>" ], CURLOPT_URL => "https://api.rev.ai/languageid/v1/jobs/" . id, CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "DELETE", ]); $response = curl_exec($curl); $error = curl_error($curl); curl_close($curl); if ($error) { echo "cURL Error #:" . $error; } else { echo $response; }
{- "title": "Authorization has been denied for this request",
- "status": 401
}
Returns the results for a completed language identification job.
Rev AI API Language Identification Result
Request Unauthorized
Job Not Found
Conflict
/** * Requires libcurl */ const id = "YOUR_id_PARAMETER"; $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_HTTPHEADER => [ "Authorization: Bearer <YOUR_TOKEN_HERE>" ], CURLOPT_URL => "https://api.rev.ai/languageid/v1/jobs/" . id . "/result", CURLOPT_RETURNTRANSFER => true, CURLOPT_CUSTOMREQUEST => "GET", ]); $response = curl_exec($curl); $error = curl_error($curl); curl_close($curl); if ($error) { echo "cURL Error #:" . $error; } else { echo $response; }
{- "top_language": "en",
- "language_confidences": [
- {
- "language": "en",
- "confidence": 0.907
}, - {
- "language": "nl",
- "confidence": 0.023
}, - {
- "language": "ar",
- "confidence": 0.023
}, - {
- "language": "de",
- "confidence": 0.023
}, - {
- "language": "cmn",
- "confidence": 0.023
}
]
}