Quickstart
Translate an article by sending its URL and your target language.
curl -X POST "http://localhost:8080/namastesumalya/translate-article-content" \
-H "apy-token: $APY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/article",
"targetLanguage": "Spanish"
}'What you'll get back
Returns a JSON object with a url string and a translated_content object. The translated_content object includes title, author, language, publicationName, and translated_body fields.
{
"url": "https://example.com/article",
"translated_content": {
"title": "El futuro de la inteligencia artificial",
"author": "John Doe",
"language": "Spanish",
"publicationName": "Tech Blog",
"translated_body": "Este artículo explora cómo la inteligencia artificial está transformando los sistemas de contenido..."
}
}Loading your default key…About this endpoint
What it does
Translates the content of an article from a web page into a target language. The request sends the article URL and the desired target language, and the response returns the source URL plus a translated article content object.
Request Body
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| url | String | Yes | The URL of the article web page to translate. |
| targetLanguage | String | Yes | The target language for the translated content. |
Response
Returns a JSON object with a url string field and a translated_content object field. The translated_content object contains translated article metadata and body content.
| Parameter | Type | Mandatory | Description |
|---|---|---|---|
| url | String | No | The source article URL. |
| translated_content | Object | No | The translated article content object. |
| translated_content.title | String | No | The translated article title. |
| translated_content.author | String | No | The article author. |
| translated_content.language | String | No | The language of the translated content. |
| translated_content.publicationName | String | No | The publication name. |
| translated_content.translated_body | String | No | The translated article body text. |