{"__v":2,"_id":"55abab0a0685ce0d0049fb8d","category":{"__v":21,"_id":"55a7aee94a33f92b00b7a154","pages":["55a7aee94a33f92b00b7a156","55a7ea403efe0c2f0074cb75","55a80eb23ec2ec0d00bd66ea","55a811fc6e61e619004f703e","55a8c513cf45e1390093f18c","55a8d9fa27a17d210052516d","55a8f048cf45e1390093f248","55aba4ba63a6b60d006616e1","55abab0a0685ce0d0049fb8d","55abb04da36ccd0d00fdebc1","55abc1cc63a6b60d006616f4","55abcdbd63a6b60d006616fa","55abd36763a6b60d00661700","55abd50ea36ccd0d00fdebdb","55abd8c3a36ccd0d00fdebdf","55abd9cc0685ce0d0049fbb5","55abdb6b63a6b60d00661706","55abdc9b0685ce0d0049fbb8","55c1f5fca131980d005be95b","55fac407bc972f0d0005f644","569f68e766a5640d00efa52d"],"project":"55a7aee84a33f92b00b7a150","version":"55a7aee84a33f92b00b7a153","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-07-16T13:17:29.102Z","from_sync":false,"order":2,"slug":"endpoints","title":"Endpoints"},"editedParams":true,"editedParams2":true,"parentDoc":null,"project":"55a7aee84a33f92b00b7a150","user":"55a7ae50bf1be93100d89df1","version":{"__v":6,"_id":"55a7aee84a33f92b00b7a153","project":"55a7aee84a33f92b00b7a150","createdAt":"2015-07-16T13:17:28.411Z","releaseDate":"2015-07-16T13:17:28.411Z","categories":["55a7aee94a33f92b00b7a154","55a7fefa3efe0c2f0074cbdf","55a8fb10c8bd450d000dd130","55a936b1cf45e1390093f362","55abddeaa36ccd0d00fdebe1","5624db675a86b423009462e1"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-07-19T13:50:02.035Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"language":"curl","code":"curl https://api.aylien.com/api/v1/summarize \\\n   -H \"X-AYLIEN-TextAPI-Application-Key: [[app:key]]\" \\\n   -H \"X-AYLIEN-TextAPI-Application-ID: [[app:id]]\" \\\n   -d sentences_number=3 \\\n   -d url=\"http://techcrunch.com/2015/04/06/john-oliver-just-changed-the-surveillance-reform-debate\""},{"language":"javascript","code":"textapi.summarize({\n  url: 'http://techcrunch.com/2015/04/06/john-oliver-just-changed-the-surveillance-reform-debate',\n  sentences_number: 3\n}, function(error, response) {\n  if (error === null) {\n    response.sentences.forEach(function(s) {\n      console.log(s);\n    });\n  }\n});"},{"language":"python","code":"url = 'http://techcrunch.com/2015/04/06/john-oliver-just-changed-the-surveillance-reform-debate'\nsummary = client.Summarize({'url': url, 'sentences_number': 3})\nfor sentence in summary['sentences']:\n  print sentence"},{"language":"php","code":"<?php\n$url = 'http://techcrunch.com/2015/04/06/john-oliver-just-changed-the-surveillance-reform-debate';\n$summary = $textapi->Summarize(array('url' => $url, 'sentences_number' => 3));\nforeach ($summary->sentences as $sentece) {\n  echo $sentece,\"\\n\";\n}\n?>"},{"language":"java","code":"SummarizeParams.Builder builder = SummarizeParams.newBuilder();\njava.net.URL url = new java.net.URL(\"http://techcrunch.com/2015/04/06/john-oliver-just-changed-the-surveillance-reform-debate\");\nbuilder.setUrl(url);\nbuilder.setNumberOfSentences(3);\nSummarize summary = client.summarize(builder.build());\nfor (String sentence: summary.getSentences()) {\n\tSystem.out.println(sentence);\n}"},{"language":"ruby","code":"url = 'http://techcrunch.com/2015/04/06/john-oliver-just-changed-the-surveillance-reform-debate'\n\nsummary = client.summarize(url: url, sentences_number: 3)\n\nsummary[:sentences].each do |sentence|\n  puts sentence\nend"},{"language":"go","code":"url := \"http://techcrunch.com/2015/04/06/john-oliver-just-changed-the-surveillance-reform-debate\"\nsummarizeParams := &textapi.SummarizeParams{URL: url, NumberOfSentences: 3}\nsummary, err := client.Summarize(summarizeParams)\nif err != nil {\n\t\tpanic(err)\n}\nfor _, s := range summary.Sentences {\n\t\tfmt.Println(s)\n}"},{"language":"csharp","code":"string url = \"http://techcrunch.com/2015/04/06/john-oliver-just-changed-the-surveillance-reform-debate\";\n\nvar summary = client.Summarize(url: url, sentencesNumber: 3).Sentences;\n\nforeach (var sentence in summary)\n{\n  Console.WriteLine(sentence);\n}"}]},"results":{"codes":[{"status":200,"language":"json","code":"{\n  \"sentences\":[\n    \"It’s been almost two years since the world was captivated by Snowden’s leaks to The Guardian and The Washington Post about American surveillance programs.\",\n    \"In response to the public outcry that followed the Snowden revelations, President Obama stipulated that congress must renew or reform the Patriot Act provision authorizing the bulk collection of Americans’ phone records by that date, or else the program will expire.\",\n    \"Snowden then went on to explain how the government uses different programs to access those pictures, from Executive Order 12333 to Section 702 of the Foreign Intelligence Surveillance Act.\"\n  ],\n  \"text\":\"For many Americans who talked to John Oliver on Last Week Tonight, the answer is no.\\n\\nIt’s been almost two years since the world was captivated by Snowden’s leaks to The Guardian and The Washington Post about American surveillance programs. For weeks it seemed there was a new headline everyday about another previously classified surveillance program or another government official calling for action on this issue. Presidential review groups were called. President Obama called for major changes to the programs.\\n\\nAlthough the Snowden leaks certainly proved to be much more than a “three-day story,” American surveillance practices remain largely the same two years later. The main difference is this issue no longer dominates our political discourse. In November, the FREEDOM Act — legislation under development for two years that would have overhauled NSA surveillance programs — died in a Senate procedural vote to little display.\\n\\nLast night we found out Oliver’s HBO program was off last week because he was in Russia interviewing “the most famous hero and/or traitor in recent American history.” Oliver hit on many points that have been lacking in past interviews with the former government contractor — from whether Snowden misses Hot Pockets to whether he’s actually read all of the documents he’s released to reporters (Snowden maintained he understands the scope of the documents).\\n\\nOliver’s interview is timely as we approach an important deadline for surveillance reform on June 1. In response to the public outcry that followed the Snowden revelations, President Obama stipulated that congress must renew or reform the Patriot Act provision authorizing the bulk collection of Americans’ phone records by that date, or else the program will expire.\\n\\nOnline this morning, Twitter, Reddit and the expected publications were abuzz with how “John Oliver killed it” and or “slayed it” in this new segment.\\n\\nDespite what network news chose to lead with, the interview’s significance extends beyond Snowden saying you should keep sending dirty pictures. It’s important because millions of people who haven’t thought about surveillance reform in months are going to click on this YouTube video and care about it again.\\n\\nLast summer we saw Oliver’s ability to captivate the public’s attention when it came to the complex, technical issue of net neutrality. His commentary prompted tens of thousands to submit comments to the Federal Communications Commission, helping net neutrality receive more public input than any other FCC docket item that came before it. In just 13 minutes, Oliver helped change the future of the Internet.\\n\\nSo what will the 33 minutes he spent on government surveillance reform do?\\n\\nThe FREEDOM Act’s failure last year can largely be attributed to a lack of public support and understanding. If the average voter doesn’t know the name Edward Snowden, how can they be expected to know about Section 215 of the Patriot Act?\\n\\nEver able to make us laugh about even the driest news topics, Oliver changed the topic of discussion from vague hypotheticals about civil liberties to something tangible he knew many Americans would care about — dick pics.\\n\\n“Well the good news is there’s no program named, ‘the dick pic program,'” Snowden said.  “The bad news is they are still collecting everybody’s information, including your dick pics.”\\n\\nSnowden then went on to explain how the government uses different programs to access those pictures, from Executive Order 12333 to Section 702 of the Foreign Intelligence Surveillance Act. He was able to explain confusing provisions of American surveillance law in just a few sentences.\\n\\nHopefully as this debate returns to Washington and we turn to more serious conversations about surveillance reform, Oliver’s jokes will keep Americans engaged and calling on their representatives to act on surveillance reform.\"\n}","name":""}]},"settings":"","auth":"required","params":[{"_id":"55a8f048cf45e1390093f249","ref":"","in":"query","required":false,"desc":"Article or webpage URL","default":"","type":"string","name":"url"},{"_id":"55aba5a5a36ccd0d00fdebba","ref":"","in":"query","required":false,"desc":"Title of the text to summarize","default":"","type":"string","name":"title"},{"_id":"55aba608a36ccd0d00fdebbb","ref":"","in":"query","required":false,"desc":"Text to summarize","default":"","type":"string","name":"text"},{"_id":"55ababae63a6b60d006616e9","ref":"","in":"query","required":false,"desc":"Summary length as number of sentences","default":"5","type":"int","name":"sentences_number"},{"_id":"55ababae63a6b60d006616e8","ref":"","in":"query","required":false,"desc":"Summary length as percentage of original document","default":"","type":"int","name":"sentences_percentage"},{"_id":"55a8f18bc8bd450d000dd113","ref":"","in":"query","required":false,"desc":"Language (refer to [Language Support](/docs/language-support))","default":"auto","type":"string","name":"language"}],"url":"/summarize"},"isReference":false,"order":5,"body":"The **Summarization** endpoint provides an easy way of summarizing a document such as a news article or blog post into a few key sentences. You can specify the length of the summary via the `sentences_number` or `sentences_percentage` parameters.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Input format\",\n  \"body\": \"You can either provide a `URL` or a combination of `text` and `title` to the Summarization endpoint. A good title often helps improve the quality of the summary as it includes the key topics mentioned in the article.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"Knowing the language of the target webpage or article often helps improve the quality of the summary, so it must be supplied via the `language` parameter whenever possible. See [Language Support](/docs/language-support) for more information.\",\n  \"title\": \"Summarization and language\"\n}\n[/block]","excerpt":"/summarize","slug":"summarize","type":"get","title":"Summarization"}

getSummarization

/summarize

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Query Params

url:
string
Article or webpage URL
title:
string
Title of the text to summarize
text:
string
Text to summarize
sentences_number:
integer5
Summary length as number of sentences
sentences_percentage:
integer
Summary length as percentage of original document
language:
stringauto
Language (refer to [Language Support](/docs/language-support))

Examples


Result Format


Documentation

The **Summarization** endpoint provides an easy way of summarizing a document such as a news article or blog post into a few key sentences. You can specify the length of the summary via the `sentences_number` or `sentences_percentage` parameters. [block:callout] { "type": "warning", "title": "Input format", "body": "You can either provide a `URL` or a combination of `text` and `title` to the Summarization endpoint. A good title often helps improve the quality of the summary as it includes the key topics mentioned in the article." } [/block] [block:callout] { "type": "warning", "body": "Knowing the language of the target webpage or article often helps improve the quality of the summary, so it must be supplied via the `language` parameter whenever possible. See [Language Support](/docs/language-support) for more information.", "title": "Summarization and language" } [/block]

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}