Extension:TextExtracts

The TextExtracts extension provides an API with allows to retrieve plain-text or limited HTML extracts of page content.

Configuration settings

 * is an array of, .class, . , and # which will be excluded from extraction.
 * For example,  removes indented text, often used for non-templated hatnotes that are not desired in summaries.
 * [https://git.wikimedia.org/tree/mediawiki%2Fextensions%2FTextExtracts TextExtracts.php] defines the defaults, of which the class "noexcerpt" is one - this may be added to any template to exclude it.
 * defines whether TextExtracts should provide its extracts to os-xml>Special:MyLanguage/Extension:OpenSearchXml|OpenSearchXml extension. The default is "false".

API
Example: api.php?action=query&prop=extracts&exchars=100&titles=Earth&format=json