डेवलपर दस्तावेज़ीकरण

वर्डली एपीआई के साथ निर्माण करें।

सर्वर-साइड एपीआई कुंजी का उपयोग करें, HTTPS अनुरोध करें और पूर्वानुमानित क्रेडिट-आधारित बिलिंग मॉडल के माध्यम से प्रत्येक कॉल को ट्रैक करें। यह संदर्भ वर्तमान में उत्पादन में उपलब्ध समापन बिंदुओं का दस्तावेजीकरण करता है और स्पष्ट रूप से उन समापन बिंदुओं को चिह्नित करता है जो अभी भी तैयार किए जा रहे हैं।

API version v1प्रारूप JSONपरिवहन केवल HTTPSनिःशुल्क शेष 50 creditsओपनएपीआई स्कीमा डाउनलोड करेंPostman CollectionPostman Environment

त्वरित शुरुआत

एक मुफ़्त खाता बनाएं, छह अंकों के कोड का उपयोग करके अपना ईमेल सत्यापित करें, और अपने डेवलपर डैशबोर्ड में दिखाई गई एपीआई कुंजी को एक बार कॉपी करें।

  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 से परोसे जाते हैं:

आधार यूआरएलhttps://api.wordlyenglish.com/v1

प्रतिक्रिया या व्यवहार परिवर्तन को तोड़ने के लिए एक नए पथ संस्करण का उपयोग किया जाएगा। एडिटिव फ़ील्ड्स को भीतर पेश किया जा सकता है v1, so clients should ignore response properties they do not recognize.

प्रमाणीकरण

प्रमाणित समापन बिंदुओं को HTTP में एक एपीआई कुंजी की आवश्यकता होती है Authorization बियरर योजना का उपयोग करते हुए हेडर।

Authorization: Bearer wly_live_your_api_key
एपीआई कुंजियाँ उजागर न करें.

ब्राउज़र जावास्क्रिप्ट, सार्वजनिक गिट रिपॉजिटरी, स्क्रीनशॉट, लॉग या वितरित मोबाइल एप्लिकेशन में कभी भी लाइव कुंजी न रखें। अपने बैकएंड से वर्डली एपीआई को कॉल करें और अपने स्वयं के एप्लिकेशन को उस बैकएंड के साथ संचार करने दें।

स्थानीयकृत एपीआई संदेश

प्रतिक्रिया भाषा को इसके साथ सेट करें ?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

विकास, स्टेजिंग और उत्पादन के लिए अलग-अलग कुंजियाँ बनाएँ। वर्डली प्रत्येक कुंजी का केवल एक क्रिप्टोग्राफ़िक हैश संग्रहीत करता है; संपूर्ण मान निर्माण के समय एक बार प्रदर्शित होता है।

  • परिवेश या सेवा के अनुसार कुंजियाँ नाम दें.
  • पर्यावरण चर या प्रबंधित गुप्त स्टोर का उपयोग करें।
  • यदि कोई कुंजी उजागर हो गई हो तो उसे तुरंत रद्द करें।
  • पुराने मानों का पुन: उपयोग किए बिना कुंजियाँ घुमाएँ।
  • क्वेरी स्ट्रिंग में कुंजियाँ न भेजें.

प्रतिक्रिया स्वरूप

सफल प्रतिक्रियाएँ शीर्ष-स्तर का उपयोग करती हैं 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जियो

सार्वजनिक सेवा स्वास्थ्य और एपीआई संस्करण की जानकारी लौटाता है। इस समापन बिंदु को प्रमाणीकरण की आवश्यकता नहीं है और इसकी लागत शून्य क्रेडिट है।

उदाहरण अनुरोध

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 से 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 समर्थित इंटरफ़ेस और एपीआई-संदेश स्थान लौटाता है। शब्दावली अनुवाद केवल तभी लौटाए जाते हैं जब उपलब्ध हों। यह समापन बिंदु सार्वजनिक है और इसकी लागत शून्य क्रेडिट है।

दर सीमा

प्रत्येक एपीआई कुंजी प्रति रोलिंग मिनट में 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गुम, विकृत, निरस्त, या निष्क्रिय कुंजी।बियरर हेडर की जाँच करें या कुंजी बदलें।
402credits_exhaustedखाते में परिचालन के लिए क्रेडिट का अभाव है।पुनः प्रयास रोकें और ग्राहक को बिलिंग के लिए निर्देशित करें।
404not_foundअनुरोधित समापन बिंदु उपलब्ध नहीं है.पथ और एपीआई संस्करण की जाँच करें।
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_exceededएपीआई कुंजी प्रति मिनट 120 अनुरोधों से अधिक हो गई।Wait for Retry-After.
5xxserver_errorएक अप्रत्याशित सर्वर-साइड विफलता.बैकऑफ़ के साथ पुनः प्रयास करें; यदि लगातार हो तो समर्थन से संपर्क करें।

अनुशंसित पुनः प्रयास नीति

पुनः प्रयास न करें 401, 402, or 404 स्वचालित रूप से. क्षणिक के लिए 5xx प्रतिक्रियाएँ, घबराहट और एक सख्त पुनः प्रयास सीमा के साथ घातीय बैकऑफ़ का उपयोग करें। कभी भी अनबाउंड रिट्री लूप न बनाएं क्योंकि प्रत्येक स्वीकृत प्रमाणित अनुरोध क्रेडिट का उपभोग कर सकता है।

जावास्क्रिप्ट / नोड.जे.एस

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'])

पीएचपी

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

डार्ट/फड़फड़ाहट

फ़्लटर एप्लिकेशन के अंदर वर्डली कुंजी न भेजें। उदाहरण एक विश्वसनीय डार्ट बैकएंड या सर्वर फ़ंक्शन से संबंधित है।

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']);
}

उत्पादन चेकलिस्ट

  • प्रॉक्सी वर्डली एक विश्वसनीय बैकएंड के माध्यम से अनुरोध करता है।
  • कनेक्शन और प्रतिक्रिया टाइमआउट सेट करें।
  • संभाल 401, 402, 404, and 5xx अलग से.
  • Query GET /v1/account when your application needs the current balance.
  • लॉग एंडपॉइंट, स्थिति, विलंबता, और request_id एपीआई कुंजी लॉग किए बिना।
  • प्रत्येक परिवेश के लिए अलग-अलग कुंजियों का उपयोग करें और उन्हें समय-समय पर घुमाएँ।
  • Cache stable vocabulary responses in your backend when appropriate.

क्या आप अपना पहला अनुरोध करने के लिए तैयार हैं?

एक खाता बनाएं, अपना ईमेल सत्यापित करें और 50 निःशुल्क क्रेडिट प्राप्त करें।

निःशुल्क खाता बनाएँ

एकीकरण सहायता की आवश्यकता है? ईमेल [email protected].