Image to Text API
Recognize English letters and numbers in images.
Image Input
Encode the image as Base64 and submit it for recognition.
Text Output
Read the English letters and numbers from the returned text field.
Synchronous Integration
Complete recognition and receive the result in a single request.
Start with Your First Request
Get a Key, copy the request, and view the corresponding JSON response below.
export ACEDATACLOUD_API_KEY="YOUR_API_KEY"
python3 - <<'PYCODE'
import base64, json
from pathlib import Path
image = base64.b64encode(Path("captcha.png").read_bytes()).decode()
Path("request.json").write_text(json.dumps({"image": image}))
PYCODE
curl --request POST "https://api.acedata.cloud/captcha/recognition/image2text" \
--header "Authorization: Bearer $ACEDATACLOUD_API_KEY" \
--header "Content-Type: application/json" \
--data @request.jsonThe following is an excerpt of key fields from the current API response. Task identifiers, usage, and generated content depend on the response to your request.
{
"text": "7364",
"elapsed": 31.6
}Read the Result
First, save the image for recognition as captcha.png. Read the recognized text returned by the API and validate the result as needed for your application.
Keep the trace_id to help troubleshoot errors. Authentication and limit settings can be viewed in the console under application and Key management.
Usage and Costs
Refer to the current API and service page for request parameters and pricing. Keep the trace_id when errors occur to help with troubleshooting.
Integrate the Image to Text API into Your Application
Continue to the complete guide for parameters, result fields, and error handling.
