SMMRY
API

SMMRY is accessible by an API. Developers are able to implement SMMRY into applications that may require a summary of a webpage or variable. Developers need to generate an API key to access this feature. To generate an API key, please see the link at the bottom of this page.

Here are the possible parameters placed in the request URL.
&SM_API_KEY=N   // Mandatory, N represents your registered API key.
&SM_LENGTH=N    // Optional, N represents the number of sentences returned, default is 6
&SM_QUOTE_AVOID // Optional, summary will not include quotations
&SM_WITH_BREAK  // Optional, summary will contain string [BREAK] between each sentence
The API request must be made to 'http://api.smmry.com'.

cURL or an equivalent function/library must send the article variable as POST data labeled sm_api_input.

Submitting just the URL for a summary is unavailable for the API.

If there is an error of any kind, the response will start with: SMMRY API ERROR:.

Here is an example of PHP using cURL to summarize a variable:
$long_article = "Long article text goes here";

$ch = curl_init("http://api.smmry.com/&SM_API_KEY=NNNNNNNNNNNNNNN&SM_LENGTH=14&SM_WITH_BREAK");
// IMPORTANT!
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Expect:"));
// IMPORTANT! Without ^this^ any article over 1000 characters will make SMMRY throw a 417 http error
curl_setopt($ch, CURLOPT_POST, true); 
curl_setopt($ch, CURLOPT_POSTFIELDS, "sm_api_input=".$long_article);// Your variable is sent as POST
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,20);
curl_setopt($ch, CURLOPT_TIMEOUT,20);
$summary = curl_exec($ch);//You're summary is now stored in $summary.
curl_close($ch);
The maximum number of sentences returned is 40. When using SM_WITH_BREAK, make sure to replace the [BREAK] strings with whatever you want to seperate each sentence ('/n', '<br>' etc). Also, make sure any webpage URL sent to summarize is accessible to SMMRY, pages requiring authentication won't do.

In exchange for this free service, the expectation is that the user of the API will make some acknowledgment on the page the SMMRY algorithm is being used. A failure to do so will lead to the banning of API key in question. Please consider making a small donation if you are heavy user of the API.

API KEY:


New registrations for the API will be enabled on the 19th 26th of February 2012.
(Sorry for delay, reason is I was hospitalized for a week for unexpected surgery)
Full Name:
Website:
Contact email:
Description
of usage:





I agree to these terms.
















    HOME | ABOUT | AUTO | API | CONTACT | REGISTER |
© 2009-2012 Amir Elmaani