Skip to main content

Summary API

The Summary API can be used to summarize any piece of text.

Arguments

  • query: The text to be summarized
  • language: The language of the text. If set to AUTO, it will default to english.

Language Codes

  • HINDI: hi,
  • VIETNAMESE: vi,
  • CHINESE_TRADITIONAL: zh-TW,
  • CHINESE_SIMPLIFIED: zh-CN,
  • RUSSIAN: ru,
  • JAPANESE: ja,
  • UKRAINIAN: uk,
  • ENGLISH: en,
  • SPANISH: es,
  • INDONESIAN: id,
  • KOREAN: ko,
  • POLISH: pl,
  • CZECH: cs,
  • FILIPINO: fil,
  • FRENCH: fr,
  • ITALIAN: it,
  • DANISH: da,
  • DUTCH: nl,
  • GERMAN: de,
  • TURKISH: tr,
  • ROMANIAN: ro,
  • THAI: th,
  • NORWEGIAN: no,
  • PORTUGUESE: pt,
  • BRAZILIAN_PORTUGUESE: pt,
  • HUNGARIAN: hu,

API Request Schema

In bash:

curl -X POST --location 'https://endpoints.getmerlin.in/services/summarize/blog' \
--header 'Content-Type: application/json' \
--header 'x-merlin-key: <YOUR_MERLIN_API_KEY>' \
--data '{
"query":"<TEXT_TO_BE_SUMMARIZED>",
"language":"AUTO"
}'

In Javascript:

const axios = require("axios");

(async () => {
const result = await axios.post(
"https://endpoints.getmerlin.in/services/summarize/blog",
{
query: "<TEXT_TO_BE_SUMMARIZED>",
language: "AUTO",
},
{
headers: {
"x-merlin-key": "<API_KEY>",
},
}
);

console.log(result.data);
})();

Response

200 Response:

{
"status": "success",
"data": {
"result": [
{
"summary": [
{
"title": "Overview of Cricket's Current State",
"points": [
"Cricket is a popular sport enjoyed by many around the world.",
"The current state of cricket is worth discussing, as it reflects the sport's evolution and challenges."
]
}
]
}
],
"title": "The Evolution and Challenges of Cricket: A Discussion of its Current State"
},
"usage": {
"used": 4401,
"limit": 10000,
"type": "b2b_employee"
}
}

400 Response:

{
"status": "error",
"error": {
"type": "UNKNOWN_ERROR",
"message": "Oopsie Daisy! Let’s pretend that never happened. Try again, maybe?"
}
}