anycaptcha.com
Searchโ€ฆ
Speech To Text (BETA)

SUPPORTED LANGUAGES

Language Code
Description
en-US
English (United States)
zh-CN
Chinese (China)
fr-FR
French (France)
ja-JP
Japanese (Japan)
ko-KR
Korean (South Korea)
ru-RU
Russian (Russia)
th-TH
Thai (Thailand)
vi-VN
Vietnamese (Vietnam)

API

  1. 1.
    First, you need to convert your audio to WAV format (we only support WAV format) Some websites support tools to convert online audio formats https://cloudconvert.com/wav-converter
  2. 2.
    POST WAV audio as base64 encode and audio language in the table above

Request

Python
C#
PHP
Java
NodeJS
import requests
โ€‹
url = "https://labs.anycaptcha.com/SpeechToTextFromBase64"
โ€‹
payload = "{ \"Base64Audio\": \"WAV audio as base64 here\", \"LanguageCode\": \"en-US\"}"
headers = {'content-type': 'application/json'}
โ€‹
response = requests.request("POST", url, data=payload, headers=headers)
โ€‹
print(response.text)
var client = new RestClient("https://labs.anycaptcha.com/SpeechToTextFromBase64");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{ \"Base64Audio\": \"WAV audio as base64 here\", \"LanguageCode\": \"en-US\"}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
<?php
โ€‹
$request = new HttpRequest();
$request->setUrl('https://labs.anycaptcha.com/SpeechToTextFromBase64');
$request->setMethod(HTTP_METH_POST);
โ€‹
$request->setHeaders(array(
'content-type' => 'application/json'
));
โ€‹
$request->setBody('{ "Base64Audio": "WAV audio as base64 here", "LanguageCode": "en-US"}');
โ€‹
try {
$response = $request->send();
โ€‹
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
OkHttpClient client = new OkHttpClient();
โ€‹
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{ \"Base64Audio\": \"WAV audio as base64 here\", \"LanguageCode\": \"en-US\"}");
Request request = new Request.Builder()
.url("https://labs.anycaptcha.com/SpeechToTextFromBase64")
.post(body)
.addHeader("content-type", "application/json")
.build();
โ€‹
Response response = client.newCall(request).execute();
var request = require("request");
โ€‹
var options = { method: 'POST',
url: 'https://labs.anycaptcha.com/SpeechToTextFromBase64',
headers: { 'content-type': 'application/json' },
body: { Base64Audio: 'WAV audio as base64 here', LanguageCode: 'en-US' },
json: true };
โ€‹
request(options, function (error, response, body) {
if (error) throw new Error(error);
โ€‹
console.log(body);
});
j

Response

{
"Success": true,
"Text": "Your verification code is 13579"
}
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
โ€‹
Copy link