POST
/
v1
/
ai
/
summary
import { JigsawStack } from "jigsawstack";

const jigsaw = JigsawStack({ apiKey: "your-api-key" });

const response = await jigsaw.summary({
  "text": "The Leaning Tower of Pisa, or simply, the Tower of Pisa, is the campanile, or freestanding bell tower, of Pisa Cathedral. It is situated behind the Cathedral and is the third-oldest structure in the city's Cathedral Square, after the Cathedral and the Baptistry. The tower's tilt began during construction in the 12th century, caused by an inadequate foundation on ground too soft on one side to properly support the structure's weight. The tilt increased in the decades before the structure was completed in the 14th century. It gradually increased until the structure was stabilized by efforts in the late 20th and early 21st centuries. The height of the tower is 55.86 metres (183.27 feet) from the ground on the low side and 56.67 metres (185.93 feet) on the high side. The width of the walls at the base is 2.44 m (8 ft 0.06 in). Its weight is estimated at 14,500 tonnes. The tower has 296 or 294 steps; the seventh floor has two fewer steps on the north-facing staircase.",
  "type": "points",
  "max_points": 3
})
{
  "success": true,
  "summary": [
        "The Leaning Tower of Pisa is the bell tower of Pisa Cathedral, built on a foundation too soft to support its weight.",
        "Construction began in the 12th century and the tilt worsened before its completion in the 14th century.",
        "The tower's tilt was stabilized in the late 20th and early 21st centuries."
  ]
}

Request Parameters

Body

text
string | string[]

The text content to summarize. Maximum 300,000 characters. Not required if url or file_store_key is specified. The text parameter supports two formats:

  • Single string: {"text":"Your long text here"}
  • Array of strings: {"text":["Long text 1", "Long text 2"]}
url
string

URL of a PDF document to summarize. Not required if text or file_store_key is provided.

file_store_key
string

The key of a stored PDF document to summarize from Jigsawstack File Storage. Not required if text or url is provided.

type
string
default:"text"

The format of the summary: - text: Returns a continuous paragraph summary - points: Returns bullet points as an array of strings

max_points
number
default:"2"

The maximum number of bullet points to generate when type is set to points. Maximum value is 100.

max_characters
number

The maximum number of characters in the generated summary.

x-api-key
string
required

Your JigsawStack API key

Response Structure

The response structure varies based on the type parameter:

When type is “text” (default)

success
boolean

Indicates whether the call was successful.

summary
string

The generated summary as a continuous paragraph.

When type is “points”

success
boolean

Indicates whether the call was successful.

summary
string[]

An array of strings, where each string represents a bullet point in the summary.