how to get translation with API in python

Topic summary

A developer is attempting to retrieve English translations of product descriptions from a French Shopify store using the Translations API in Python. The site uses Shopify’s “Translate & Adapt” feature for translations.

The Problem:

  • API calls consistently return “NO Translation” errors
  • Current approach queries /admin/api/{version}/translations.json with locale=“en”, resource_type=“Product”, and a specific product ID
  • Code loops through translations looking for “body_html” key

Technical Details:
The provided code snippet shows a standard GET request structure with proper parameters, but the translations array appears empty or the expected key isn’t being found.

Status: The question remains unanswered - the developer is seeking guidance on the correct API approach to access translated product descriptions from Translate & Adapt.

Summarized with AI on October 27. AI used: claude-sonnet-4-5-20250929.

Hello,

my website is in frend and translate in english thanks to Translate & Adapt

I would like to get the english description.

but each time i have the error “NO Translation”

translation_url = f"https://{SHOPIFY_STORE}/admin/api/{API_VERSION}/translations.json"
params = {
    "locale": "en",
    "resource_type": "Product",
    "resource_id": PRODUCT_ID
}

response = requests.get(translation_url, headers=headers, params=params)
data = response.json()

translations = data.get("translations", [])
body_html_en = None

for t in translations:
    if t.get("key") == "body_html":
        body_html_en = t.get("value")
        break

if body_html_en:
    print("Description anglaise trouvée :")
    print(body_html_en)
else:
    print("Pas de traduction anglaise disponible.")

What is the good way?

Thanks for your help

Ben