Skip to content
POST/api/astro/translate/1 credit

Text translation

A thin wrapper over Google Cloud Translation, offered so that chart text produced elsewhere in this API can be shown in another language without you holding a separate Google key. It performs no astrological calculation of its own. Post `text` with an optional `target_language` (an ISO code, defaulting to `hi` for Hindi) and an optional `source_language` (defaulting to `en`); omit or blank the source and Google will detect it. The response is a flat object with `original_text`, `translated_text`, `source_language` (the detected code when you did not supply one) and `target_language`. Note that, unlike most endpoints here, it is not wrapped in a `data` envelope. A failure reaching or parsing the upstream service is returned as a 502.

https://yogataraapi.prahlad.app/api/astro/translate/
Test Request

Authentication

Send your key in the X-API-Key header. Keys are server-side credentials — never put one in browser JavaScript or a mobile app.

X-API-Key: yt_live_a1b2c3d4_…
Content-Type: application/json

Request fields

FieldTypeRequiredNotes
textstringrequired
source_languagestringoptional
target_languagestringoptional

Example request

curl -X POST https://yogataraapi.prahlad.app/api/astro/translate/ \
  -H "X-API-Key: $OCCULT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Sun in Aries"}'

Response

{
  "original_text": "Sun in Aries",
  "translated_text": "मेष राशि में सूर्य",
  "source_language": "en",
  "target_language": "hi"
}

Captured from a real call using the exact request above. Results sit under data.

Errors

Metering errors return { "error": "…", "message": "<code>", "is_error": true }. Show error to people and branch on message. See the error reference.