開発者向けドキュメント

Wordly API を使用して構築します。

サーバー側 API キーを使用し、HTTPS リクエストを作成し、予測可能なクレジットベースの請求モデルを通じてすべての通話を追跡します。このリファレンスには、実稼働環境で現在利用可能なエンドポイントが文書化されており、まだ準備中のエンドポイントが明確にマークされています。

API version v1フォーマット JSON輸送 HTTPSのみフリーバランス 50 creditsオープンAPI スキーマをダウンロードするPostman CollectionPostman Environment

クイックスタート

無料アカウントを作成し、6 桁のコードを使用して電子メールを認証し、開発者ダッシュボードに一度表示された API キーをコピーします。

  1. 1
    アカウントを作成する

    メールアドレスとパスワードのみでご登録いただけます。

  2. 2
    メールアドレスを確認してください

    から送られてきたコードを入力してください [email protected]. Verification grants 50 free credits.

  3. 3
    API キーを保存する

    生成されたものをコピーする wly_live_... キーを取得し、サーバー側の環境変数に保持します。

  4. 4
    テストリクエストをする

    アカウント エンドポイントを呼び出して認証を確認し、残高を確認します。

シェル
curl "https://api.wordlyenglish.com/v1/account" \
  -H "Authorization: Bearer $WORDLY_API_KEY" \
  -H "Accept: application/json"
200 response
{
  "data": {
    "message": "Authenticated",
    "credits_remaining": 50
  },
  "meta": { "lang": "en" }
}

ベース URL とバージョン管理

すべての運用エンドポイントは、次のバージョン管理されたベース URL から提供されます。

ベースURLhttps://api.wordlyenglish.com/v1

重大な応答または動作の変更には、新しいパス バージョンが使用されます。加算フィールドは内に導入される可能性があります v1, so clients should ignore response properties they do not recognize.

認証

認証されたエンドポイントには HTTP の API キーが必要です Authorization Bearer スキームを使用したヘッダー。

Authorization: Bearer wly_live_your_api_key
API キーを公開しないでください。

ブラウザの JavaScript、パブリック Git リポジトリ、スクリーンショット、ログ、または分散モバイル アプリケーションにはライブ キーを決して配置しないでください。バックエンドから Wordly API を呼び出し、独自のアプリケーションがそのバックエンドと通信できるようにします。

ローカライズされた API メッセージ

応答言語を設定します ?lang=tr または標準 Accept-Language ヘッダー。クエリパラメータが優先されます。すべての JSON 応答は、選択されたロケールを次のように宣言します。 Content-Language そして meta.lang. Error codes remain stable in English for programmatic handling; only the human-readable message is localized.

curl "https://api.wordlyenglish.com/v1/account?lang=tr" \
  -H "Authorization: Bearer $WORDLY_API_KEY" \
  -H "Accept-Language: tr-TR"

サポートされている言語コード: 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.

クレジットと請求

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.

操作信用コスト可用性
GET /v1/status0ライブ
GET /v1/account0ライブ
GET /v1/words/{word}1–5ライブ
GET /v1/words/search1ライブ
GET /v1/words/random1 per wordライブ
POST /v1/words/batch返された記録に基づいてライブ

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 操作を処理しません。

402 response
{
  "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"
  }
}

API key lifecycle

開発、ステージング、本番用に個別のキーを作成します。 Wordly は各キーの暗号ハッシュのみを保存します。完全な値は作成時に一度表示されます。

  • 環境またはサービスごとにキーに名前を付けます。
  • 環境変数またはマネージド シークレット ストアを使用します。
  • キーが公開された可能性がある場合は、直ちにキーを取り消してください。
  • 古い値を再利用せずにキーをローテーションします。
  • クエリ文字列でキーを送信しないでください。

応答フォーマット

成功した応答ではトップレベルが使用されます。 data オブジェクトであり、 meta オブジェクト。エラーは常にトップレベルを使用します error 安定した機械可読性を持つオブジェクト code そして人間が読める形式 message.

リクエストが成功しました
{
  "data": { ... },
  "meta": {
    "credits_used": 1,
    "request_id": "..."
  }
}
失敗したリクエスト
{
  "error": {
    "code": "invalid_api_key",
    "message": "..."
  }
}

保管してください request_id 成功した請求リクエストについてサポートに連絡するとき。 JSON は UTF-8 でエンコードされており、クライアントは送信する必要があります。 Accept: application/json.

Cache behavior

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.

エンドポイントリファレンス

実稼働エンドポイント

ゲット/v1/statusライブ

パブリック サービスの健全性と API のバージョン情報を返します。このエンドポイントは認証を必要とせず、クレジットのコストはゼロです。

リクエスト例

curl "https://api.wordlyenglish.com/v1/status" \
  -H "Accept: application/json"

200 · Success

{
  "data": { "status": "ok", "version": "v1" },
  "meta": { "lang": "en" }
}
Possible results200 Service is reachable.405 Method is not GET.429 IP request limit exceeded.
ゲット/v1/accountLive · 0 credits

Validates the supplied key and returns the current account balance without charging a credit.

ヘッダー

名前必須説明
AuthorizationはいBearer wly_live_...
Acceptおすすめapplication/json

応答ヘッダー

X-Credits-Remaining is returned only by this balance endpoint.

200 · Success

{
  "data": { "message": "Authenticated", "credits_remaining": 1250 },
  "meta": { "lang": "en" }
}
Possible results200 Key accepted and balance returned.401 Missing, invalid, revoked, or suspended key.429 Rate limit exceeded.

語彙のエンドポイント

20,000+ catalog entries are live.

すべての記録がその内容を報告します completeness として catalog, translated, or enriched. Fields that are not available are returned as null または、作成されたデータの代わりに空のオブジェクト。

GET /v1/words/{word}

完全に一致する単語を返します。使用する languages=tr,de,fr 要求された翻訳のみを返します。カタログまたは翻訳されたレコードには 1 クレジットがかかります。完全に充実したプロファイルには 5 クレジットがかかります。

curl "https://api.wordlyenglish.com/v1/words/water?languages=tr,de" \
  -H "Authorization: Bearer $WORDLY_API_KEY"

GET /v1/words/search

で検索 q そしてオプションの level, part_of_speech, category, limit, and cursor. Limits range from 1 to 50. Pass meta.next_cursor 次のリクエストに移ります。

curl "https://api.wordlyenglish.com/v1/words/search?q=app&level=advanced&limit=20" \
  -H "Authorization: Bearer $WORDLY_API_KEY"

GET /v1/words/random

1 ~ 20 個のランダムな単語を返します。フィルター条件 level, part_of_speech, or category. Each returned slot costs one credit.

POST /v1/words/batch

1 回のリクエストで 1 ~ 50 個の一意の単語を検索します。応答では要求の順序が保持され、すべての項目にマークが付けられます。 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

サポートされている 30 のインターフェイスおよび API メッセージ ロケールをすべて返します。語彙の翻訳は、利用可能な場合にのみ返されます。このエンドポイントはパブリックであり、クレジットの費用はゼロです。

レート制限

各 API キーは、ローリング 1 分あたり受け入れられるリクエストの数が 120 に制限されています。応答には次のものが含まれます X-RateLimit-Limit そして X-RateLimit-Remaining. A 429 rate_limit_exceeded 応答には以下が含まれます Retry-After: 60.

ゲット/v1/languagesLive · 0 credits

Lists all supported interface and API-message locales. Vocabulary translations are returned only when a record contains them.

Query parameters

名前Type必須Rules説明
langstringNoSupported locale codeLanguage for human-readable messages.

リクエスト例

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" }
}
Possible results200 Locale list returned.405 Method is not GET.429 IP request limit exceeded.
ゲット/v1/words/{word}Live · 1–5 credits

Returns one exact vocabulary record. Catalog and translated records cost 1 credit; enriched records cost 5 credits.

Parameters

名前LocationType必須Rules and meaning
wordPathstringはいExact word or slug; maximum 120 characters. URL-encode special characters.
languagesQuerystringNoComma-separated translation codes, for example tr,de,fr.
langQuerystringNoHuman-readable message language; not a vocabulary filter.

リクエスト例

シェル
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" }
}
Possible results200 Exact record returned.401 Invalid API key.402 Insufficient credits.404 Word not found.422 Word too long.429 Rate limit exceeded.
ゲット/v1/words/randomLive · 1 credit per requested slot

Returns random active words for quizzes, discovery feeds, and practice sessions.

Query parameters

名前Type必須Default / limit説明
countintegerNo1; min 1, max 20Requested slots and credit cost.
levelstringNoExact valueLevel filter.
part_of_speech / posstringNoExact valueGrammatical-class filter.
categorystringNoExact valueCategory filter.
languagesstringNoComma-separatedTranslations to include.

リクエスト例

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 }
}
Possible results200 Random array returned.401 Invalid API key.402 Balance below requested count.429 Rate limit exceeded.
POST/v1/words/batchLive · calculated

Looks 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.

ヘッダー

名前必須Value
AuthorizationはいBearer wly_live_...
Content-Typeはいapplication/json
Acceptおすすめapplication/json

JSON body

FieldType必須Rules説明
wordsstring[]はい1–50 items; each max 120 charsWords to resolve; duplicates are normalized and removed.
languagesstring[]NoSupported locale codesTranslations to include.

リクエスト例

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" }
}
Possible results200 Ordered results.401 Invalid API key.402 Insufficient credits.413 Body over 64 KB.415 Content-Type is not JSON.422 Invalid words array.429 Rate limit exceeded.

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

FieldTypeNullable説明
idstringNoStable URL-safe slug.
wordstringNoCanonical English word.
part_of_speechstringはいGrammatical class.
levelstringはいLearning difficulty or catalog level.
definitionstringはいConcise English definition.
examplestringはいNatural example sentence.
phoneticstringはいPronunciation transcription when available.
translationsobject<string,string>NoLocale codes mapped to translations; may be empty.
synonymsstring[]NoAvailable synonyms.
antonymsstring[]NoAvailable antonyms.
categoriesstring[]NoLearning or semantic categories.
media.image_urlURL stringはいLearning image URL.
media.audio_urlURL stringはいPronunciation audio URL.
media.attributionobjectNoRequired media attribution metadata.
completenessenumNocatalog, translated, or enriched.

Meta object

FieldTypeWhen present説明
credits_usedintegerMetered responsesCredits charged by this request.
request_idUUID stringMetered successSupport and billing trace ID.
langstringAlwaysSelected message locale.
countintegerList responsesNumber of response items.
next_cursorstring or nullSearchNext page cursor; null means final page.

Error object

FieldType説明
error.codestringStable machine-readable code.
error.messagestringLocalized human-readable explanation.
error.upgrade_urlstringRelative billing URL on a 402 result.
meta.langstringError-message locale.

エラー

HTTPコード意味クライアントのアクション
401invalid_api_keyキーが欠落しているか、形式が正しくないか、取り消されているか、または非アクティブです。Bearer ヘッダーを確認するか、キーを交換してください。
402credits_exhaustedアカウントには操作に必要なクレジットがありません。再試行を停止し、お客様に請求を案内します。
404not_found要求されたエンドポイントは利用できません。パスとAPIのバージョンを確認してください。
404word_not_found要求された語彙エントリは利用できません。スペルをチェックするか、検索を使用してください。
422invalid_requestパラメータまたはバッチ本体が無効です。再試行する前にリクエストを修正してください。
405method_not_allowedThe endpoint does not accept the HTTP method.Use the documented GET or POST method.
413payload_too_largeThe JSON request body exceeds 64 KB.Reduce the batch body.
415unsupported_media_typeThe batch request is not JSON.Send Content-Type: application/json.
429rate_limit_exceededAPI キーが 1 分あたり 120 リクエストを超えました。Wait for Retry-After.
5xxserver_error予期しないサーバー側の障害。バックオフを使用して再試行します。解決しない場合はサポートにお問い合わせください。

推奨される再試行ポリシー

再試行しないでください 401, 402, or 404 自動的に。過渡用 5xx 応答には、ジッターと厳格な再試行制限を伴う指数バックオフを使用します。承認された認証リクエストごとにクレジットが消費される可能性があるため、無制限の再試行ループを作成しないでください。

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);

パイソン

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);

ダーツ/フラッター

Wordly キーを Flutter アプリケーション内に同梱しないでください。この例は、信頼できる 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']);
}

製作チェックリスト

  • Wordly リクエストは信頼できるバックエンドを通じてプロキシされます。
  • 接続と応答のタイムアウトを設定します。
  • ハンドル 401, 402, 404, and 5xx 別に。
  • Query GET /v1/account when your application needs the current balance.
  • エンドポイント、ステータス、遅延、および request_id API キーをログに記録しないでください。
  • 環境ごとに個別のキーを使用し、定期的にローテーションします。
  • Cache stable vocabulary responses in your backend when appropriate.

最初のリクエストをする準備はできましたか?

アカウントを作成し、メールアドレスを認証すると、50 クレジットを無料で受け取ります。

無料アカウントを作成する

統合に関するサポートが必要ですか?電子メール [email protected].