Construa com API Wordly.
Use uma chave de API do lado do servidor, faça solicitações HTTPS e rastreie cada chamada por meio de um modelo de faturamento previsível baseado em crédito. Esta referência documenta os endpoints atualmente disponíveis em produção e marca claramente os endpoints que ainda estão sendo preparados.
Início rápido
Crie uma conta gratuita, verifique seu e-mail usando o código de seis dígitos e copie a chave API mostrada uma vez no painel do desenvolvedor.
- 1Crie uma conta
Registre-se apenas com um endereço de e-mail e senha.
- 2Verifique seu e-mail
Digite o código enviado por
[email protected]. A verificação concede 50 créditos gratuitos. - 3Armazene sua chave de API
Copie o gerado
wly_live_...chave e mantê-la em uma variável de ambiente do lado do servidor. - 4Faça uma solicitação de teste
Ligue para o endpoint da conta para verificar a autenticação e ver o saldo restante.
curl "https://api.wordlyenglish.com/v1/account" \
-H "Authorization: Bearer $WORDLY_API_KEY" \
-H "Accept: application/json"{
"data": {
"message": "Authenticated",
"credits_remaining": 50
},
"meta": { "lang": "en" }
}URL base e controle de versão
Todos os endpoints de produção são servidos a partir do seguinte URL base com versão:
https://api.wordlyenglish.com/v1Quebrar respostas ou mudanças de comportamento usará uma nova versão do caminho. Campos aditivos podem ser introduzidos dentro v1, portanto, os clientes devem ignorar as propriedades de resposta que não reconhecem.
Autenticação
Endpoints autenticados exigem uma chave de API no HTTP Authorization cabeçalho usando o esquema Bearer.
Authorization: Bearer wly_live_your_api_keyNunca coloque uma chave ativa no JavaScript do navegador, em repositórios Git públicos, em capturas de tela, logs ou em um aplicativo móvel distribuído. Chame a API Wordly de seu back-end e deixe seu próprio aplicativo se comunicar com esse back-end.
Mensagens de API localizadas
Defina o idioma de resposta com ?lang=tr ou o padrão Accept-Language cabeçalho. Os parâmetros de consulta têm precedência. Cada resposta JSON declara a localidade selecionada em Content-Language e meta.lang. Os códigos de erro permanecem estáveis em inglês para tratamento programático; apenas a mensagem legível por humanos é localizada.
curl "https://api.wordlyenglish.com/v1/account?lang=tr" \
-H "Authorization: Bearer $WORDLY_API_KEY" \
-H "Accept-Language: tr-TR"Códigos de idioma suportados: en, tr, de, fr, es, it, pt, nl, pl, ru, uk, ar, fa, he, hi, bn, ur, zh, ja, ko, id, ms, vi, th, sv, no, da, fi, cs, ro.
Créditos e cobrança
Each successful metered request consumes the documented number of credits. Email-verified accounts receive 50 free credits once. Credits are deducted atomically, so concurrent requests cannot spend the same balance twice. Balance lookup through GET /v1/account is free.
| Operação | Custo de crédito | Disponibilidade |
|---|---|---|
GET /v1/status | 0 | Ao vivo |
GET /v1/account | 0 | Ao vivo |
GET /v1/words/{word} | 1–5 | Ao vivo |
GET /v1/words/search | 1 | Ao vivo |
GET /v1/words/random | 1 por palavra | Ao vivo |
POST /v1/words/batch | Com base nos registros retornados | Ao vivo |
Use GET /v1/account when you need the current balance. Other endpoint responses include the operation charge but omit the remaining balance. When the balance is insufficient, the API returns HTTP 402 e não processa a operação.
{
"error": {
"code": "credits_exhausted",
"message": "Your credit balance is exhausted. Add a package or enable pay-as-you-go to continue.",
"upgrade_url": "/app.php?page=billing"
}
}Ciclo de vida da chave de API
Crie chaves separadas para desenvolvimento, preparação e produção. O Wordly armazena apenas um hash criptográfico de cada chave; o valor completo é exibido uma vez na criação.
- Nomeie as chaves por ambiente ou serviço.
- Use variáveis de ambiente ou um armazenamento secreto gerenciado.
- Revogue uma chave imediatamente se ela tiver sido exposta.
- Gire as chaves sem reutilizar valores antigos.
- Não envie chaves em strings de consulta.
Formato de resposta
As respostas bem-sucedidas usam um nível superior data objeto e pode incluir um meta objeto. Erros sempre usam um nível superior error objeto com um legível por máquina estável code e um legível por humanos message.
{
"data": { ... },
"meta": {
"credits_used": 1,
"request_id": "..."
}
}{
"error": {
"code": "invalid_api_key",
"message": "..."
}
}Mantenha o request_id ao entrar em contato com o suporte sobre uma solicitação faturada com sucesso. JSON é codificado em UTF-8 e os clientes devem enviar Accept: application/json.
Wordly caches shared vocabulary data on the server, never API keys, account identities, balances, rate-limit state, or request identifiers. Public status and language responses advertise shared-cache lifetimes. Authenticated responses remain private, no-store; applications may cache the stable data value in their own trusted backend when appropriate.
Pontos de extremidade de produção
/v1/statusAo vivoRetorna informações sobre a integridade do serviço público e a versão da API. Este endpoint não requer autenticação e não custa nenhum crédito.
Solicitação de exemplo
curl "https://api.wordlyenglish.com/v1/status" \
-H "Accept: application/json"200 · Success
{
"data": { "status": "ok", "version": "v1" },
"meta": { "lang": "en" }
}/v1/accountLive · 0 creditsValidates the supplied key and returns the current account balance without charging a credit.
Cabeçalhos
| Nome | Obrigatório | Descrição |
|---|---|---|
Authorization | Sim | Bearer wly_live_... |
Accept | Recomendado | application/json |
Cabeçalhos de resposta
X-Credits-Remaining is returned only by this balance endpoint.
200 · Success
{
"data": { "message": "Authenticated", "credits_remaining": 1250 },
"meta": { "lang": "en" }
}Pontos finais de vocabulário
Cada registro relata seu completeness como catalog, translated, ou enriched. Os campos que não estão disponíveis são retornados como null ou um objeto vazio em vez de dados inventados.
GET /v1/words/{word}
Retorna uma correspondência exata de palavras. Usar languages=tr,de,fr para retornar apenas as traduções solicitadas. Registros catalogados ou traduzidos custam 1 crédito; perfis totalmente enriquecidos custam 5 créditos.
curl "https://api.wordlyenglish.com/v1/words/water?languages=tr,de" \
-H "Authorization: Bearer $WORDLY_API_KEY"GET /v1/words/search
Pesquisar com q e opcional level, part_of_speech, category, limite cursor. Os limites variam de 1 a 50. Aprovado meta.next_cursor na próxima solicitação.
curl "https://api.wordlyenglish.com/v1/words/search?q=app&level=advanced&limit=20" \
-H "Authorization: Bearer $WORDLY_API_KEY"GET /v1/words/random
Retorna de 1 a 20 palavras aleatórias. Filtrar por level, part_of_speech, ou category. Cada slot devolvido custa um crédito.
POST /v1/words/batch
Procura entre 1 e 50 palavras únicas em uma única solicitação. A resposta preserva a ordem da solicitação e marca cada item com found.
curl -X POST "https://api.wordlyenglish.com/v1/words/batch?lang=tr" \
-H "Authorization: Bearer $WORDLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"words":["water","opportunity"],"languages":["tr","de"]}'GET /v1/languages
Retorna todas as 30 interfaces suportadas e localidades de mensagens de API. As traduções de vocabulário são retornadas somente quando disponíveis. Este endpoint é público e não custa nenhum crédito.
Limite de taxa
Cada chave de API é limitada a 120 solicitações aceitas por minuto contínuo. As respostas incluem X-RateLimit-Limit e X-RateLimit-Remaining. Um 429 rate_limit_exceeded a resposta inclui Retry-After: 60.
/v1/languagesLive · 0 creditsLists all supported interface and API-message locales. Vocabulary translations are returned only when a record contains them.
Query parameters
| Nome | Type | Obrigatório | Rules | Descrição |
|---|---|---|---|---|
lang | string | No | Supported locale code | Language for human-readable messages. |
Solicitação de exemplo
curl "https://api.wordlyenglish.com/v1/languages?lang=tr"200 · Success
{
"data": [{
"code": "tr",
"name": "Türkçe",
"message_localization": true,
"vocabulary_translation": "when_available"
}],
"meta": { "count": 30, "lang": "tr" }
}/v1/words/{word}Live · 1–5 creditsReturns one exact vocabulary record. Catalog and translated records cost 1 credit; enriched records cost 5 credits.
Parameters
| Nome | Location | Type | Obrigatório | Rules and meaning |
|---|---|---|---|---|
word | Path | string | Sim | Exact word or slug; maximum 120 characters. URL-encode special characters. |
languages | Query | string | No | Comma-separated translation codes, for example tr,de,fr. |
lang | Query | string | No | Human-readable message language; not a vocabulary filter. |
Solicitação de exemplo
curl "https://api.wordlyenglish.com/v1/words/water?languages=tr,de" \
-H "Authorization: Bearer $WORDLY_API_KEY" \
-H "Accept: application/json"200 · Success
{
"data": {
"id": "water",
"word": "water",
"part_of_speech": "noun",
"level": "basic",
"definition": "A clear liquid essential for life.",
"example": "Please drink enough water every day.",
"translations": { "tr": "su", "de": "Wasser" },
"categories": ["nature", "daily-life"],
"media": {
"image_url": "https://media.example/water.webp",
"audio_url": "https://media.example/water.mp3",
"attribution": {}
},
"completeness": "enriched"
},
"meta": {
"credits_used": 5,
"request_id": "5ebac760-cdc5-4a73-a87b-22463d81483c",
"lang": "en"
}
}404 · Word unavailable
{
"error": { "code": "word_not_found", "message": "The requested word was not found." },
"meta": { "lang": "en" }
}/v1/words/searchAo vivo · 1 créditoSearches active vocabulary in alphabetical order. Use the returned cursor for stable forward pagination.
Query parameters
| Nome | Type | Obrigatório | Default / limit | Descrição |
|---|---|---|---|---|
q | string | No | Max 120 chars | Case-insensitive contained text. |
level | string | No | Max 30 chars | Exact level filter. |
part_of_speech / pos | string | No | Max 40 chars | Exact grammatical-class filter. |
category | string | No | Max 80 chars | Category-array filter. |
limit | integer | No | 20; min 1, max 50 | Maximum returned records. |
cursor | string | No | Max 120 chars | Previous meta.next_cursor. |
languages | string | No | Comma-separated | Translations to include. |
Solicitação de exemplo
curl "https://api.wordlyenglish.com/v1/words/search?q=app&level=advanced&languages=tr&limit=2" \
-H "Authorization: Bearer $WORDLY_API_KEY"200 · Success
{
"data": [{
"id": "application",
"word": "application",
"part_of_speech": "noun",
"level": "advanced",
"definition": null,
"example": null,
"translations": { "tr": "uygulama" },
"categories": [],
"media": { "image_url": null, "audio_url": null, "attribution": {} },
"completeness": "translated"
}],
"meta": { "credits_used": 1, "request_id": "...", "lang": "en", "count": 1, "next_cursor": null }
}/v1/words/randomLive · 1 credit per requested slotReturns random active words for quizzes, discovery feeds, and practice sessions.
Query parameters
| Nome | Type | Obrigatório | Default / limit | Descrição |
|---|---|---|---|---|
count | integer | No | 1; min 1, max 20 | Requested slots and credit cost. |
level | string | No | Exact value | Level filter. |
part_of_speech / pos | string | No | Exact value | Grammatical-class filter. |
category | string | No | Exact value | Category filter. |
languages | string | No | Comma-separated | Translations to include. |
Solicitação de exemplo
curl "https://api.wordlyenglish.com/v1/words/random?count=3&level=basic&languages=tr" \
-H "Authorization: Bearer $WORDLY_API_KEY"200 · Success
{
"data": [{ "id": "water", "word": "water", "part_of_speech": "noun", "level": "basic", "definition": null, "example": null, "translations": { "tr": "su" }, "categories": [], "media": { "image_url": null, "audio_url": null, "attribution": {} }, "completeness": "translated" }],
"meta": { "credits_used": 3, "request_id": "...", "lang": "en", "count": 1 }
}/v1/words/batchLive · calculatedLooks up 1–50 unique words while preserving request order. Each enriched result costs 5 credits, another found result costs 1, and the minimum request charge is 1.
Cabeçalhos
| Nome | Obrigatório | Value |
|---|---|---|
Authorization | Sim | Bearer wly_live_... |
Content-Type | Sim | application/json |
Accept | Recomendado | application/json |
JSON body
| Field | Type | Obrigatório | Rules | Descrição |
|---|---|---|---|---|
words | string[] | Sim | 1–50 items; each max 120 chars | Words to resolve; duplicates are normalized and removed. |
languages | string[] | No | Supported locale codes | Translations to include. |
Solicitação de exemplo
curl -X POST "https://api.wordlyenglish.com/v1/words/batch?lang=tr" \
-H "Authorization: Bearer $WORDLY_API_KEY" \
-H "Content-Type: application/json" \
-d '{"words":["water","not-a-word"],"languages":["tr","de"]}'200 · Success
{
"data": [
{ "query": "water", "found": true, "word": { "id": "water", "word": "water", "part_of_speech": "noun", "level": "basic", "definition": null, "example": null, "translations": { "tr": "su", "de": "Wasser" }, "categories": [], "media": { "image_url": null, "audio_url": null, "attribution": {} }, "completeness": "translated" } },
{ "query": "not-a-word", "found": false, "word": null }
],
"meta": { "credits_used": 1, "request_id": "...", "lang": "tr", "count": 2 }
}422 · Invalid body
{
"error": { "code": "invalid_request", "message": "Provide between 1 and 50 words." },
"meta": { "lang": "en" }
}Response field reference
Every stable response variable is described below. Additive fields may appear later, so clients should ignore fields they do not recognize.
Vocabulary object
| Field | Type | Nullable | Descrição |
|---|---|---|---|
id | string | No | Stable URL-safe slug. |
word | string | No | Canonical English word. |
part_of_speech | string | Sim | Grammatical class. |
level | string | Sim | Learning difficulty or catalog level. |
definition | string | Sim | Concise English definition. |
example | string | Sim | Natural example sentence. |
phonetic | string | Sim | Pronunciation transcription when available. |
translations | object<string,string> | No | Locale codes mapped to translations; may be empty. |
synonyms | string[] | No | Available synonyms. |
antonyms | string[] | No | Available antonyms. |
categories | string[] | No | Learning or semantic categories. |
media.image_url | URL string | Sim | Learning image URL. |
media.audio_url | URL string | Sim | Pronunciation audio URL. |
media.attribution | object | No | Required media attribution metadata. |
completeness | enum | No | catalog, translated, ou enriched. |
Meta object
| Field | Type | When present | Descrição |
|---|---|---|---|
credits_used | integer | Metered responses | Credits charged by this request. |
request_id | UUID string | Metered success | Support and billing trace ID. |
lang | string | Always | Selected message locale. |
count | integer | List responses | Number of response items. |
next_cursor | string or null | Search | Next page cursor; null means final page. |
Error object
| Field | Type | Descrição |
|---|---|---|
error.code | string | Stable machine-readable code. |
error.message | string | Localized human-readable explanation. |
error.upgrade_url | string | Relative billing URL on a 402 result. |
meta.lang | string | Error-message locale. |
Erros
| HTTP | Código | Significado | Ação do cliente |
|---|---|---|---|
| 401 | invalid_api_key | Chave ausente, malformada, revogada ou inativa. | Verifique o cabeçalho do portador ou substitua a chave. |
| 402 | credits_exhausted | A conta não possui créditos para a operação. | Interrompa novas tentativas e direcione o cliente para o faturamento. |
| 404 | not_found | O endpoint solicitado não está disponível. | Verifique o caminho e a versão da API. |
| 404 | word_not_found | A entrada de vocabulário solicitada não está disponível. | Verifique a ortografia ou use a pesquisa. |
| 422 | invalid_request | Um parâmetro ou corpo de lote é inválido. | Corrija a solicitação antes de tentar novamente. |
| 405 | method_not_allowed | The endpoint does not accept the HTTP method. | Use the documented GET or POST method. |
| 413 | payload_too_large | The JSON request body exceeds 64 KB. | Reduce the batch body. |
| 415 | unsupported_media_type | The batch request is not JSON. | Send Content-Type: application/json. |
| 429 | rate_limit_exceeded | A chave de API excedeu 120 solicitações por minuto. | Espere por Retry-After. |
| 5xx | server_error | Uma falha inesperada no servidor. | Tente novamente com espera; entre em contato com o suporte se persistir. |
Política de repetição recomendada
Não tente novamente 401, 402, ou 404 automaticamente. Para transitório 5xx respostas, use espera exponencial com jitter e um limite estrito de novas tentativas. Nunca crie um loop de repetição ilimitado porque cada solicitação autenticada aceita pode consumir créditos.
JavaScript/Node.js
const response = await fetch('https://api.wordlyenglish.com/v1/account', {
headers: {
Authorization: `Bearer ${process.env.WORDLY_API_KEY}`,
Accept: 'application/json'
}
});
const body = await response.json();
if (!response.ok) {
throw new Error(`${body.error.code}: ${body.error.message}`);
}
console.log(body.data.credits_remaining);Pitão
import os
import requests
response = requests.get(
'https://api.wordlyenglish.com/v1/account',
headers={
'Authorization': f'Bearer {os.environ["WORDLY_API_KEY"]}',
'Accept': 'application/json',
},
timeout=15,
)
response.raise_for_status()
print(response.json()['data']['credits_remaining'])PHP
$curl = curl_init('https://api.wordlyenglish.com/v1/account');
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 15,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('WORDLY_API_KEY'),
'Accept: application/json',
],
]);
$body = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
curl_close($curl);
if ($status >= 400) {
throw new RuntimeException('Wordly API request failed');
}
$data = json_decode($body, true, flags: JSON_THROW_ON_ERROR);Dardo / vibração
Não envie a chave do Wordly dentro de um aplicativo Flutter. O exemplo pertence a um back-end ou função de servidor confiável do Dart.
final response = await http.get(
Uri.parse('https://api.wordlyenglish.com/v1/account'),
headers: {
'Authorization': 'Bearer ${Platform.environment['WORDLY_API_KEY']}',
'Accept': 'application/json',
},
);
final body = jsonDecode(response.body) as Map<String, dynamic>;
if (response.statusCode >= 400) {
throw Exception((body['error'] as Map)['code']);
}Lista de verificação de produção
- Solicitações proxy do Wordly por meio de um back-end confiável.
- Defina tempos limite de conexão e resposta.
- Alça
401,402,404e5xxseparadamente. - Query
GET /v1/accountwhen your application needs the current balance. - Registrar endpoint, status, latência e
request_idsem registrar a chave API. - Use chaves separadas por ambiente e alterne-as periodicamente.
- Cache stable vocabulary responses in your backend when appropriate.
Pronto para fazer seu primeiro pedido?
Crie uma conta, verifique seu e-mail e receba 50 créditos grátis.
Precisa de ajuda na integração? E-mail [email protected].