इसे छोड़कर कंटेंट पर जाएं

Pronunciation API — Using your API key

यह कंटेंट अभी तक आपकी भाषा में उपलब्ध नहीं है।

This guide is for when you already have an nd_live_… key — for example, one issued to you for a trial. It gets you from a key to a working call in a couple of minutes.

https://names-api.namedropiome.workers.dev

Pass the key in the x-api-key header on every request. Treat it like a password — use it from your server, never ship it in client-side code.

x-api-key: nd_live_xxxxxxxx

A name search is the simplest place to start.

Terminal window
curl -H "x-api-key: nd_live_xxxxxxxx" \
"https://names-api.namedropiome.workers.dev/search?q=smith&country=US"
const BASE = "https://names-api.namedropiome.workers.dev";
const res = await fetch(`${BASE}/search?q=smith&country=US`, {
headers: { "x-api-key": process.env.NAMEDROP_API_KEY },
});
if (!res.ok) {
throw new Error(`NameDrop API ${res.status}`);
}
const { data } = await res.json();
console.log(data[0]?.phonetic_simple);
{
"success": true,
"data": [
{
"name": "Smith",
"cultural_origin": "English",
"phonetic_simple": "smith",
"audio_file": "Smith.mp3"
}
],
"query": "smith",
"parsed": { "original": "smith", "matched": "smith", "type": "first_name_country" },
"country": "US"
}

Each item in data is a Name object (full shape in the reference). To play audio, call GET /audio/{id} for a fresh signed URL. Need a phonetic guide for a name that isn’t in the database? Call GET /phonetic. Synthesizing new audio with POST /generate-audio requires a Pro or Enterprise plan.

Check the status code and, for trial limits, branch on the stable code field — not the message text.

StatuscodeWhat to do
401Key missing or invalid — check the header.
402trial_expiredTrial window ended — upgrade.
402trial_exhausted200-call trial cap reached — upgrade.
403tier_not_allowedEndpoint needs a higher plan (audio generation is Pro/Enterprise).
429Daily tier limit hit — retry after 00:00 UTC.
const res = await fetch(`${BASE}/search?q=smith`, {
headers: { "x-api-key": process.env.NAMEDROP_API_KEY },
});
if (res.status === 402) {
const { code } = await res.json(); // "trial_expired" | "trial_exhausted"
// surface an upgrade prompt to the user
}