Перейти до вмісту
AstroWay/api v2.95.1 · docs
усі системи в нормі

Translate (astro-aware)

POST
/translate/astro
request.sh
curl -X POST https://api.astroway.info/v1/translate/astro \
-H "X-Api-Key: aw_live_..." \
-H "Content-Type: application/json" \
-d '{ "text": "Mercury is retrograde in Gemini.", "target_lang": "de", "domain": "western" }'

Translate one text into any of 21 languages with astrology-domain glossary pinning. Source defaults to English; pass source_lang to override. Credits: 15 + ceil(chars/40). Max 3000 chars.

Media type application/json
object
Example
{
"text": "Mercury is retrograde in Gemini.",
"target_lang": "de",
"domain": "western"
}

Successful calculation

Media type application/json
object
ok
boolean
data
object
translated
string
nullable
source_lang
string
nullable
target_lang
string
nullable
domain
string
nullable
provider
string
nullable
chars
number
nullable
credits
number
nullable
Example
{
"ok": true,
"data": {
"translated": "Merkur ist rückläufig in den Zwillingen.",
"source_lang": "en",
"target_lang": "de",
"domain": "western",
"provider": "gemini",
"chars": 32,
"credits": 16
}
}

Validation error

Media type application/json
Example
{
"ok": false,
"error": {
"code": "INVALID_INPUT",
"message": "Validation failed: date: Date must be YYYY-MM-DD",
"details": [
{
"path": "date",
"message": "Date must be YYYY-MM-DD"
}
]
}
}

Missing or invalid API key

Media type application/json
Example
{
"ok": false,
"error": {
"code": "INVALID_API_KEY",
"message": "Invalid API key"
}
}
Корисно?