Audio CAPTCHA API

Solve audio challenges with advanced audio processing

Overview

The Audio CAPTCHA API allows you to transcribe audio into text, such as Google reCAPTCHA audio challenges. Our advanced audio processing technology accurately converts spoken digits and letters into text, helping you automate solutions for accessibility-focused CAPTCHA challenges.

Endpoint

POST
/api/recaptcha/audio

Request

Headers

Name Required Description
Content-Type Yes application/json
x-api-key Yes Your API key

Body Parameters

Parameter Type Required Description
audioUrl string Yes URL of the reCAPTCHA audio file (mp3)

Example Request

{
  "audioUrl": "https://www.google.com/recaptcha/api2/payload/audio.mp3?..."
}

Response

Success Response (200 OK)

{
  "isSuccess": true,
  "statusCode": 200,
  "errorMessage": null,
  "data": {
    "captchaGUID": "7587c9c6-cf5f-4dc9-a382-a808a2d90dc8",
    "prediction": "43 79 28 61"
  }
}

Response Fields

Field Type Description
isSuccess boolean Indicates if the request was successful
statusCode number HTTP status code
errorMessage string Error message (null if successful)
data.captchaGUID string Unique identifier for this solution (use this for reporting incorrect predictions)
data.prediction string The transcribed text from the audio file (usually space-separated digits)

Error Response

{
  "isSuccess": false,
  "statusCode": 400,
  "errorMessage": "Invalid audio URL or unable to download audio file.",
  "data": null
}

Error Codes

Status Code Message Description
400 Invalid audio URL The provided URL is not valid or accessible
401 Unauthorized Invalid API key or not provided
403 Insufficient balance Your account has insufficient balance to process this request
500 Internal server error Something went wrong with our audio processing service

Tips for Best Results

  • Audio URL: Extract the direct URL to the audio file from the reCAPTCHA iframe.
  • URL Expiration: Note that reCAPTCHA audio URLs typically expire quickly, so process them immediately after extraction.
  • Reporting: Report any incorrect transcriptions to help improve our system.

Example Use Case: Google reCaptcha Audio Challenge

How to Get reCAPTCHA Audio URL

To use this API, you need to extract the audio URL from a Google reCAPTCHA challenge. Here's how to do it:

  1. Access the reCAPTCHA audio mode: Click on the audio icon in the reCAPTCHA challenge.
  2. Extract the audio URL: Using browser developer tools, inspect the audio element and find the source URL, which typically looks like:
    https://www.google.com/recaptcha/api2/payload/audio.mp3?...
  3. Send the URL to our API: Use the extracted URL in your API request to get the transcription.
The audio URL contains an authentication token and expires quickly, usually within minutes. Make sure to process it immediately after extraction.

Code Examples

using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

public class RecaptchaAudioExample
{
    private static readonly HttpClient client = new HttpClient();
    private const string ApiUrl = "/api/recaptcha/audio";
    private const string ApiKey = "YOUR_API_KEY";

    public static async Task SolveRecaptchaAudio(string audioUrl)
    {
        // Prepare request
        client.DefaultRequestHeaders.Add("x-api-key", ApiKey);

        var payload = new
        {
            audioUrl = audioUrl
        };

        var content = new StringContent(
            JsonConvert.SerializeObject(payload),
            Encoding.UTF8,
            "application/json"
        );

        // Send request
        var response = await client.PostAsync(ApiUrl, content);
        var responseString = await response.Content.ReadAsStringAsync();
        
        // Parse response
        dynamic result = JsonConvert.DeserializeObject(responseString);
        
        if (result.isSuccess)
        {
            return result.data.prediction;
        }
        else
        {
            throw new Exception($"Error: {result.errorMessage}");
        }
    }
}
import requests
import json

API_URL = "/api/recaptcha/audio"
API_KEY = "YOUR_API_KEY"

def solve_recaptcha_audio(audio_url):
    # Prepare headers and payload
    headers = {
        "Content-Type": "application/json",
        "x-api-key": API_KEY
    }
    
    payload = {
        "audioUrl": audio_url
    }
    
    # Make request
    response = requests.post(API_URL, headers=headers, json=payload)
    result = response.json()
    
    if result["isSuccess"]:
        return result["data"]["prediction"]
    else:
        raise Exception(f"Error: {result['errorMessage']}")

# Example usage
try:
    audio_url = "https://www.google.com/recaptcha/api2/payload/audio.mp3?..."
    captcha_text = solve_recaptcha_audio(audio_url)
    print(f"reCAPTCHA solved: {captcha_text}")
except Exception as e:
    print(str(e))
// reCAPTCHA Audio Solving Example

async function solveRecaptchaAudio(audioUrl) {
  const API_URL = "/api/recaptcha/audio";
  const API_KEY = "YOUR_API_KEY";
  
  // Prepare request
  const payload = {
    audioUrl: audioUrl
  };
  
  // Send request
  const response = await fetch(API_URL, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-api-key': API_KEY
    },
    body: JSON.stringify(payload)
  });
  
  const result = await response.json();
  
  if (result.isSuccess) {
    return result.data.prediction;
  } else {
    throw new Error(`Error: ${result.errorMessage}`);
  }
}

// Example of extracting audio URL from reCAPTCHA
function extractRecaptchaAudioUrl() {
  const audioElement = document.querySelector('audio[src*="recaptcha/api2/payload"]');
  if (audioElement && audioElement.src) {
    return audioElement.src;
  }
  throw new Error('No reCAPTCHA audio found');
}

// Example usage
async function handleRecaptchaAudio() {
  try {
    const audioUrl = extractRecaptchaAudioUrl();
    const captchaText = await solveRecaptchaAudio(audioUrl);
    console.log(`reCAPTCHA solved: ${captchaText}`);
    
    // Use the solved reCAPTCHA in your form
    document.getElementById('g-recaptcha-response').value = captchaText;
  } catch (error) {
    console.error(error.message);
  }
}