WikiPage

WikiPage

WikiPage

Source:

Methods

Paginated backlinks from page

Source:
Parameters:
Name Type Attributes Description
aggregated Boolean <optional>

return all backlinks (default is true)

limit Number <optional>

number of backlinks per page

Returns:
Type:
Promise
  • includes results [and next function for more results if not aggregated]

categories(aggregatedopt, limitopt) → {Promise}

Paginated categories from page

Source:
Parameters:
Name Type Attributes Description
aggregated Boolean <optional>

return all categories (default is true)

limit Number <optional>

number of categories per page

Returns:
Type:
Promise
  • returns results if aggregated [and next function for more results if not aggregated]
Example
wiki().page('batman').then(page => page.categories()).then(console.log);

chain() → {QueryChain}

Returns a QueryChain for the page

Source:
Returns:
Type:
QueryChain

content() → {Promise}

Useful for extracting structured section content from the page

Source:
Returns:
Type:
Promise
Example
wiki.page('batman').then(page => page.content()).then(console.log);

coordinates() → {Promise}

Geographical coordinates from page

Source:
Returns:
Type:
Promise
Example
wiki().page('Texas').then(texas => texas.coordinates())

External links from page

Source:
Returns:
Type:
Promise
Example
wiki().page('batman').then(page => page.externalLinks()).then(console.log);
// or
wiki().chain().search('batman').extlinks().request()

fullInfo() → {Promise}

Get the full infobox data, parsed in a easy to use manner

Source:
Returns:
Type:
Promise
  • Parsed object of all infobox data
Example
new Wiki().page('Batman').then(page => page.fullInfo()).then(info => info.general.aliases);

html() → {Promise}

HTML from page

Source:
Returns:
Type:
Promise
Example
wiki.page('batman').then(page => page.html()).then(console.log);

images() → {Promise}

Image URL's from page

Source:
Returns:
Type:
Promise
Example
wiki.page('batman').then(page => page.image()).then(console.log);

info(keyopt) → {Promise}

Get general information from page, with optional specifc property

Deprecated:
  • This method will be dropped and replaced with the `fullInfo` implementation in v5
Source:
Parameters:
Name Type Attributes Description
key String <optional>

Information key. Falsy keys are ignored

Returns:
Type:
Promise
  • info Object contains key/value pairs of infobox data, or specific value if key given
Example
wiki().page('Batman').then(page => page.info('alter_ego'));

Get list of links to different translations

Source:
Returns:
Type:
Promise
  • includes link objects { lang, title, url }

Paginated links from page

Source:
Parameters:
Name Type Attributes Description
aggregated Boolean <optional>

return all links (default is true)

limit Number <optional>

number of links per page

Returns:
Type:
Promise
  • returns results if aggregated [and next function for more results if not aggregated]
Example
wiki().page('batman').then(page => page.links()).then(console.log);

mainImage() → {Promise}

Main image URL from infobox on page

Source:
Returns:
Type:
Promise
Example
wiki.page('batman').then(page => page.mainImage()).then(console.log);

pageImage()

Main page image directly from API

Source:
Returns:

URL

rawContent() → {Promise}

Raw content from page

Source:
Returns:
Type:
Promise
Example
wiki.page('batman').then(page => page.rawContent()).then(console.log);

rawImages() → {Promise}

Raw data from images from page

Source:
Returns:
Type:
Promise
Example
wiki.page('batman').then(page => page.rawImages()).then(console.log);

references() → {Promise}

References from page

Source:
Returns:
Type:
Promise
Example
wiki().page('batman').then(page => page.references()).then(console.log);

summary() → {Promise}

Text summary from page

Source:
Returns:
Type:
Promise
Example
wiki.page('batman').then(page => page.summary()).then(console.log);

tables() → {Promise}

Fetch and parse tables within page

Source:
Returns:
Type:
Promise

Resolves to a collection of tables

url() → {String}

Get URL for wiki page

Source:
Returns:
Type:
String