Dictionary

Word Pronunciation

0calls
1 credits / call

Not sure how to read a word from its phonetics? Use this endpoint to attach clear, natural pronunciation, with UK and US accents you can switch freely.

GET
uapis.cn
/api/v1/dictionary/audio
Query parameters
2
word
string
required

The English word to pronounce, up to 64 characters.

accent
string

Accent preference: uk (British) or us (American). Defaults to uk.

Overview

Just pass the word text and the desired accent, and the endpoint responds directly with a binary .mp3 audio stream. You can drop the endpoint URL straight into a frontend <audio> tag to play it, or download and save it as a local audio file. The audio field returned by the Word Lookup endpoint is also just a pre-assembled URL for this endpoint.

Notes

Note

Data format: On success this endpoint returns a binary audio/mpeg stream, not regular JSON. If you call it with Fetch or Axios, be sure to read the response as a blob or arraybuffer.

Query parameters

word
stringrequired

The English word to pronounce, up to 64 characters.

accent
stringoptional

Accent preference: uk (British) or us (American). Defaults to uk.

Response

200 / OK

Success; the response body is binary MP3 audio data.

audio/mpeg

400 / Bad Request

Invalid parameters, e.g. empty word or an unsupported accent.

404 / Not Found

No audio file found for the word.

JSON
{
  "code": "AUDIO_NOT_FOUND",
  "message": "No pronunciation found for the word"
}

502 / Bad Gateway

The pronunciation service is temporarily unavailable. Please retry later.

JSON
{
  "code": "SERVICE_UNAVAILABLE",
  "message": "The pronunciation service is temporarily unavailable. Please retry later."
}