SMMRY API
Developers are able to implement SMMRY into a variety of applications. Developers will need a SMMRY API key in order to access the API.
API Key
To receive an API key, you'll need a Partner account.
To get started you'll need to register for a free account. Once registered head to the partner page and click upgrade. An API key will be generated automatically.
Modes
The SMMRY API has two modes, Free and Full:
Free: 100 free API requests can be made daily, each request must be at least 10 seconds apart. If a request was made too soon, the API will wait the required time before fulfilling the request.
Full: An unlimited amount of requests can be made with no wait required between requests. A credit normally costs $0.001, and when purchased in bulk the cost can be as low as $0.00045. When you make an API request we'll deduct 1 credit per 500 characters returned by the API (only summarized content is counted). We'll deduct an additional 8 credits if the article has not been previously submitted and summarized by the algorithm. Please note when credit costs are being calculated, decimals are rounded upwards.
You can switch between modes via your Partner account page. (you can also find your API key listed there!)
Requests
The API request must be made to https://api.smmry.com. The returned response will be encoded in JSON.
Parameters
SM_API_KEY=N | Required, your API key. |
SM_URL=X | Optional, the webpage to summarize. |
SM_LENGTH=N | Optional, the number of sentences returned, default 7. |
SM_KEYWORD_COUNT=N | Optional, the number of keywords to return. |
SM_WITH_BREAK | Optional, inserts the string [BREAK] between sentences. |
SM_WITH_ENCODE | Optional, converts HTML entities to their applicable chars. |
SM_IGNORE_LENGTH | Optional, returns summary regardless of quality or length. |
SM_QUOTE_AVOID | Optional, sentences with quotations will be excluded. |
SM_QUESTION_AVOID | Optional, sentences with question will be excluded. |
SM_EXCLAMATION_AVOID | Optional, sentences with exclamation marks will be excluded. |
JSON Payload Response
sm_api_message | Contains notices, warnings, and error messages. |
sm_api_character_count | Contains the amount of characters returned. |
sm_api_title | Contains the title when available. |
sm_api_content | Contains the summary. |
sm_api_keyword_array | Contains top ranked keywords in descending order. |
sm_api_error | Contains error code. |
The maximum number of sentences returned is 40.
PHP
Here is an example of PHP using cURL to summarize a block of text:
$text = "Your long text goes here..."; $ch = curl_init("https://api.smmry.com/&SM_API_KEY=X"); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Expect:")); // See Note curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, "sm_api_input=".$text); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 20); curl_setopt($ch, CURLOPT_TIMEOUT, 20); $return = json_decode(curl_exec($ch), true); curl_close($ch);
Note: CURLOPT_HTTPHEADER is required and should not be removed.
Here is an example of PHP using cURL to summarize an external webpage:
$ch = curl_init("https://api.smmry.com/&SM_API_KEY=X&SM_URL=http://example.com"); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,20); curl_setopt($ch, CURLOPT_TIMEOUT,20); $return = json_decode(curl_exec($ch), true); curl_close($ch);
Note: The parameter SM_URL= should always be at the end of the request.
Unofficial Packages
Name | Author | Link |
Smmry PHP SDK | dayrev | https://github.com/dayrev/smmry-sdk-php |
Smmry PHP Client | farnarv | https://github.com/farnarv/smmry |
Summarizer | dayrev | https://github.com/dayrev/summarizer |
Name | Author | Link |
SMMRY API Wrapper | dsynkov | https://github.com/dsynkov/smmryAPI |
smmryBot | FaizanHaiider | https://github.com/FaizanHaiider/smmryBot |
wikiSMMRY | hello-adi | https://github.com/hello-adi/wikiSMMRY |
summarizer | sprengvogel | https://github.com/sprengvogel/summarizer |
TL_DrBot | MrYo531 | https://github.com/MrYo531/TL-DrBot |
Recap Reddit Bot | gilaniasher | https://github.com/gilaniasher/recap-reddit-bot |
Name | Author | Link |
node-smmry | dantheuber | https://github.com/dantheuber/node-smmry |
SmmryBot | howardhwtam | https://github.com/howardhwtam/smmrybot |
SMMRY-Client | jaafarskafi1 | https://github.com/jaafarskafi1/SMMRY-Client |
SMMRY-Client | ROODAY | https://github.com/ROODAY/SMMRY-Client |
Name | Author | Link |
SmmrySharp | ghostiek | https://github.com/ghostiek/SmmrySharp |
SmmryCoreSharp | ajordan2984 | https://github.com/ajordan2984/SmmryCoreSharp |
Summary.NET | ghostiek | https://github.com/ghostiek/Summary.NET |
summerbot | matthewd673 | https://github.com/matthewd673/summerbot |
Name | Author | Link |
Article-Summarizer | TimKrash | https://github.com/TimKrash/Article-Summarizer |
Name | Author | Link |
Summarizer | CR-Mercado | https://github.com/CR-Mercado/Summarizer |
Rsmmry | nevrome | https://github.com/nevrome/Rsmmry |
Name | Author | Link |
sumerian | MayorMonty | https://github.com/MayorMonty/sumerian |
Name | Author | Link |
smmry_impl | TheCynosure | https://github.com/TheCynosure/smmry_impl |