openapi.api.PageContentApi

November 22, 2023 ยท View on GitHub

Load the API package

import 'package:wikipedia_api/api.dart';

All URIs are relative to /api/rest_v1

MethodHTTP requestDescription
getContentMediaListGET /page/media-list/{title}Get list of media files used on a page.
getContentMobileHtmlGET /page/mobile-html/{title}Get page content HTML optimized for mobile consumption.
getContentWithRevisionMediaListGET /page/media-list/{title}/{revision}Get list of media files used on a page.
getContentWithRevisionMobileHtmlGET /page/mobile-html/{title}/{revision}Get page content HTML optimized for mobile consumption.
getFormatRevisionGET /page/html/{title}/{revision}Get HTML for a specific title/revision & optionally timeuuid.
getRelatedPagesGET /page/related/{title}Get pages related to the given title
pageDataParsoidTitleRevisionTidGetGET /page/data-parsoid/{title}/{revision}/{tid}Get data-parsoid metadata for a specific title/revision/tid.
pageGetGET /page/List page-related API entry points.
pageHtmlTitleGetGET /page/html/{title}Get latest HTML for a title.
pageLintTitleGetGET /page/lint/{title}Get the linter errors for a specific title/revision.
pageLintTitleRevisionGetGET /page/lint/{title}/{revision}Get the linter errors for a specific title/revision.
pageMobileHtmlOfflineResourcesTitleGetGET /page/mobile-html-offline-resources/{title}Get styles and scripts for offline consumption of mobile-html-formatted pages
pageMobileHtmlOfflineResourcesTitleRevisionGetGET /page/mobile-html-offline-resources/{title}/{revision}Get styles and scripts for offline consumption of mobile-html-formatted pages
pagePdfTitleFormatGetGET /page/pdf/{title}/{format}Get a page as PDF
pagePdfTitleFormatTypeGetGET /page/pdf/{title}/{format}/{type}Get a page as PDF
pagePdfTitleGetGET /page/pdf/{title}Get a page as PDF
pageRandomFormatGetGET /page/random/{format}Get content for a random page
pageSegmentsTitleGetGET /page/segments/{title}Fetches a segmented page to be used in machine translation
pageSegmentsTitleRevisionGetGET /page/segments/{title}/{revision}Fetches a segmented page to be used in machine translation
pageSummaryTitleGetGET /page/summary/{title}Get basic metadata and simplified article introduction.
pageTitleTitleGetGET /page/title/{title}Get revision metadata for a title.
pageTitleTitleRevisionGetGET /page/title/{title}/{revision}Get revision metadata for a title.

getContentMediaList

MediaList getContentMediaList(title, redirect)

Get list of media files used on a page.

Gets the list of media items (images, audio, and video) in the order in which they appear on a given wiki page. Stability: unstable Please follow wikitech-l or mediawiki-api-announce for announcements of breaking changes.

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final title = title_example; // String | Page title. Use underscores instead of spaces. Use percent-encoding. Example: `Main_Page`.
final redirect = true; // bool | Requests for [redirect pages](https://www.mediawiki.org/wiki/Help:Redirects) return HTTP 302 with a redirect target in `Location` header and content in the body. To get a 200 response instead, supply `false` to the `redirect` parameter. 

try {
    final result = api_instance.getContentMediaList(title, redirect);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->getContentMediaList: $e\n');
}

Parameters

NameTypeDescriptionNotes
titleStringPage title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.
redirectboolRequests for redirect pages return HTTP 302 with a redirect target in Location header and content in the body. To get a 200 response instead, supply false to the redirect parameter.[optional]

Return type

MediaList

Authorization

No authorization required

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getContentMobileHtml

String getContentMobileHtml(title, redirect)

Get page content HTML optimized for mobile consumption.

Gets the content HTML optimized for mobile consumption for the given page. This content is derived from Parsoid HTML (see /page/html/{title} endpoint). The difference to Parsoid HTML is roughly: * Some elements and attributes not needed for the reading case are removed. * LeadIntroductionTransform: The introductory paragraph is moved before an infobox. * RedLinks: Red links are flattened (=turned into span elements). * WidenImage: images that should be displayed in gallery are widened. * Section headings are slightly changed by wrapping the headings inside a div and adding a span element inside the new div for the edit buttons. * Additional classes are added to img elements to fix issues with non-white backgrounds. See Theme support below for instructions on how to enable that. * Pagelib CSS files needed to display the content are referenced. * LazyLoadTransform: server-side portion/prep for lazy loading of images. * CollapseTable: server-side portion/prep for collapsing tables. What's not included? What parts of the PageLibrary does a client still have to do? * Theme support: Themes can be turned on by adding a theme class to the root tag. Possible class names are: * pagelib_theme_default * pagelib_theme_dark * pagelib_theme_black * pagelib_theme_sepia The pagelib JS has functionality to do that: ThemeTransform.setTheme(document, theme). * Dim images: DimImagesTransform.dim(window, enable) * PlatformTransform.classify(window) to trigger Android and iOS app specific CSS rules * LazyLoadTransformer: client side companion of LazyLoadTransform (note the extra er here) * FooterTransformer: seems to be more UI than content, requires I18N, too Stability: experimental

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final title = title_example; // String | Page title. Use underscores instead of spaces. Use percent-encoding. Example: `Main_Page`.
final redirect = true; // bool | Requests for [redirect pages](https://www.mediawiki.org/wiki/Help:Redirects) return HTTP 302 with a redirect target in `Location` header and content in the body. To get a 200 response instead, supply `false` to the `redirect` parameter. 

try {
    final result = api_instance.getContentMobileHtml(title, redirect);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->getContentMobileHtml: $e\n');
}

Parameters

NameTypeDescriptionNotes
titleStringPage title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.
redirectboolRequests for redirect pages return HTTP 302 with a redirect target in Location header and content in the body. To get a 200 response instead, supply false to the redirect parameter.[optional]

Return type

String

Authorization

No authorization required

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getContentWithRevisionMediaList

MediaList getContentWithRevisionMediaList(title, revision, redirect)

Get list of media files used on a page.

Gets the list of media items (images, audio, and video) in the order in which they appear on a given wiki page. Stability: unstable Please follow wikitech-l or mediawiki-api-announce for announcements of breaking changes.

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final title = title_example; // String | Page title. Use underscores instead of spaces. Use percent-encoding. Example: `Main_Page`.
final revision = 56; // int | Optional page revision. Note that older revisions are not stored, so request latency with the revision would be higher. 
final redirect = true; // bool | Requests for [redirect pages](https://www.mediawiki.org/wiki/Help:Redirects) return HTTP 302 with a redirect target in `Location` header and content in the body. To get a 200 response instead, supply `false` to the `redirect` parameter. 

try {
    final result = api_instance.getContentWithRevisionMediaList(title, revision, redirect);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->getContentWithRevisionMediaList: $e\n');
}

Parameters

NameTypeDescriptionNotes
titleStringPage title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.
revisionintOptional page revision. Note that older revisions are not stored, so request latency with the revision would be higher.
redirectboolRequests for redirect pages return HTTP 302 with a redirect target in Location header and content in the body. To get a 200 response instead, supply false to the redirect parameter.[optional]

Return type

MediaList

Authorization

No authorization required

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getContentWithRevisionMobileHtml

String getContentWithRevisionMobileHtml(title, revision, redirect)

Get page content HTML optimized for mobile consumption.

Gets the content HTML optimized for mobile consumption for the given page. This content is derived from Parsoid HTML (see /page/html/{title} endpoint). The difference to Parsoid HTML is roughly: * Some elements and attributes not needed for the reading case are removed. * LeadIntroductionTransform: The introductory paragraph is moved before an infobox. * RedLinks: Red links are flattened (=turned into span elements). * WidenImage: images that should be displayed in gallery are widened. * Section headings are slightly changed by wrapping the headings inside a div and adding a span element inside the new div for the edit buttons. * Additional classes are added to img elements to fix issues with non-white backgrounds. See Theme support below for instructions on how to enable that. * Pagelib CSS files needed to display the content are referenced. * LazyLoadTransform: server-side portion/prep for lazy loading of images. * CollapseTable: server-side portion/prep for collapsing tables. What's not included? What parts of the PageLibrary does a client still have to do? * Theme support: Themes can be turned on by adding a theme class to the root tag. Possible class names are: * pagelib_theme_default * pagelib_theme_dark * pagelib_theme_black * pagelib_theme_sepia The pagelib JS has functionality to do that: ThemeTransform.setTheme(document, theme). * Dim images: DimImagesTransform.dim(window, enable) * PlatformTransform.classify(window) to trigger Android and iOS app specific CSS rules * LazyLoadTransformer: client side companion of LazyLoadTransform (note the extra er here) * FooterTransformer: seems to be more UI than content, requires I18N, too Stability: experimental

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final title = title_example; // String | Page title. Use underscores instead of spaces. Use percent-encoding. Example: `Main_Page`.
final revision = 56; // int | Optional page revision. Note that older revisions are not stored, so request latency with the revision would be higher. 
final redirect = true; // bool | Requests for [redirect pages](https://www.mediawiki.org/wiki/Help:Redirects) return HTTP 302 with a redirect target in `Location` header and content in the body. To get a 200 response instead, supply `false` to the `redirect` parameter. 

try {
    final result = api_instance.getContentWithRevisionMobileHtml(title, revision, redirect);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->getContentWithRevisionMobileHtml: $e\n');
}

Parameters

NameTypeDescriptionNotes
titleStringPage title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.
revisionintOptional page revision. Note that older revisions are not stored, so request latency with the revision would be higher.
redirectboolRequests for redirect pages return HTTP 302 with a redirect target in Location header and content in the body. To get a 200 response instead, supply false to the redirect parameter.[optional]

Return type

String

Authorization

No authorization required

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getFormatRevision

String getFormatRevision(title, revision, redirect, stash, acceptLanguage)

Get HTML for a specific title/revision & optionally timeuuid.

Stability: stable

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final title = title_example; // String | Page title. Use underscores instead of spaces. Use percent-encoding. Example: `Main_Page`.
final revision = 56; // int | The revision
final redirect = true; // bool | Requests for [redirect pages](https://www.mediawiki.org/wiki/Help:Redirects) return HTTP 302 with a redirect target in `Location` header and content in the body. To get a 200 response instead, supply `false` to the `redirect` parameter. 
final stash = true; // bool | Whether to temporary stash data-parsoid in order to support transforming the modified content later. If this parameter is set, requests are rate-limited on a per-client basis (max 5 requests per second per client) 
final acceptLanguage = acceptLanguage_example; // String | The desired language variant code for wikis where LanguageConverter is enabled. Example: `sr-el` for Latin transcription of the Serbian language. 

try {
    final result = api_instance.getFormatRevision(title, revision, redirect, stash, acceptLanguage);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->getFormatRevision: $e\n');
}

Parameters

NameTypeDescriptionNotes
titleStringPage title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.
revisionintThe revision
redirectboolRequests for redirect pages return HTTP 302 with a redirect target in Location header and content in the body. To get a 200 response instead, supply false to the redirect parameter.[optional]
stashboolWhether to temporary stash data-parsoid in order to support transforming the modified content later. If this parameter is set, requests are rate-limited on a per-client basis (max 5 requests per second per client)[optional]
acceptLanguageStringThe desired language variant code for wikis where LanguageConverter is enabled. Example: sr-el for Latin transcription of the Serbian language.[optional]

Return type

String

Authorization

No authorization required

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getRelatedPages

Related getRelatedPages(title)

Get pages related to the given title

Returns summaries for 20 pages related to the given page. Summaries include page title, namespace and id along with short text description of the page and a thumbnail. Stability: experimental

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final title = title_example; // String | Page title. Use underscores instead of spaces. Use percent-encoding. Example: `Main_Page`.

try {
    final result = api_instance.getRelatedPages(title);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->getRelatedPages: $e\n');
}

Parameters

NameTypeDescriptionNotes
titleStringPage title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.

Return type

Related

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

pageDataParsoidTitleRevisionTidGet

DataParsoid pageDataParsoidTitleRevisionTidGet(title, revision, tid, redirect)

Get data-parsoid metadata for a specific title/revision/tid.

Data-parsoid is metadata used by Parsoid to support clean round-tripping conversions between HTML and Wikitext. Among other things, it contains the original Wikitext offsets of each HTML element, keyed by element ID. The format is unstable. The metadata in data-parsoid is specific to a specific HTML render. For this reason, you need to supply the exact revision and tid as provided in the ETag header of the HTML response. Stability: Stable

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final title = title_example; // String | Page title. Use underscores instead of spaces. Use percent-encoding. Example: `Main_Page`.
final revision = 56; // int | The revision
final tid = tid_example; // String | The revision's time ID
final redirect = true; // bool | Requests for [redirect pages](https://www.mediawiki.org/wiki/Help:Redirects) return HTTP 302 with a redirect target in `Location` header and content in the body. To get a 200 response instead, supply `false` to the `redirect` parameter. 

try {
    final result = api_instance.pageDataParsoidTitleRevisionTidGet(title, revision, tid, redirect);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->pageDataParsoidTitleRevisionTidGet: $e\n');
}

Parameters

NameTypeDescriptionNotes
titleStringPage title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.
revisionintThe revision
tidStringThe revision's time ID
redirectboolRequests for redirect pages return HTTP 302 with a redirect target in Location header and content in the body. To get a 200 response instead, supply false to the redirect parameter.[optional]

Return type

DataParsoid

Authorization

No authorization required

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

pageGet

Listing pageGet()

List page-related API entry points.

Stability: stable

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();

try {
    final result = api_instance.pageGet();
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->pageGet: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

Listing

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

pageHtmlTitleGet

String pageHtmlTitleGet(title, redirect, stash, acceptLanguage)

Get latest HTML for a title.

Stability: stable

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final title = title_example; // String | Page title. Use underscores instead of spaces. Use percent-encoding. Example: `Main_Page`.
final redirect = true; // bool | Requests for [redirect pages](https://www.mediawiki.org/wiki/Help:Redirects) return HTTP 302 with a redirect target in `Location` header and content in the body. To get a 200 response instead, supply `false` to the `redirect` parameter. 
final stash = true; // bool | Whether to temporary stash data-parsoid in order to support transforming the modified content later. If this parameter is set, requests are rate-limited on a per-client basis (max 5 requests per second per client) 
final acceptLanguage = acceptLanguage_example; // String | The desired language variant code for wikis where LanguageConverter is enabled. Example: `sr-el` for Latin transcription of the Serbian language. 

try {
    final result = api_instance.pageHtmlTitleGet(title, redirect, stash, acceptLanguage);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->pageHtmlTitleGet: $e\n');
}

Parameters

NameTypeDescriptionNotes
titleStringPage title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.
redirectboolRequests for redirect pages return HTTP 302 with a redirect target in Location header and content in the body. To get a 200 response instead, supply false to the redirect parameter.[optional]
stashboolWhether to temporary stash data-parsoid in order to support transforming the modified content later. If this parameter is set, requests are rate-limited on a per-client basis (max 5 requests per second per client)[optional]
acceptLanguageStringThe desired language variant code for wikis where LanguageConverter is enabled. Example: sr-el for Latin transcription of the Serbian language.[optional]

Return type

String

Authorization

No authorization required

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

pageLintTitleGet

Object pageLintTitleGet(title)

Get the linter errors for a specific title/revision.

Stability: experimental

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final title = title_example; // String | Page title. Use underscores instead of spaces. Use percent-encoding. Example: `Main_Page`.

try {
    final result = api_instance.pageLintTitleGet(title);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->pageLintTitleGet: $e\n');
}

Parameters

NameTypeDescriptionNotes
titleStringPage title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.

Return type

Object

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

pageLintTitleRevisionGet

Object pageLintTitleRevisionGet(title, revision)

Get the linter errors for a specific title/revision.

Stability: experimental

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final title = title_example; // String | Page title. Use underscores instead of spaces. Use percent-encoding. Example: `Main_Page`.
final revision = 56; // int | The revision

try {
    final result = api_instance.pageLintTitleRevisionGet(title, revision);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->pageLintTitleRevisionGet: $e\n');
}

Parameters

NameTypeDescriptionNotes
titleStringPage title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.
revisionintThe revision

Return type

Object

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

pageMobileHtmlOfflineResourcesTitleGet

String pageMobileHtmlOfflineResourcesTitleGet(title)

Get styles and scripts for offline consumption of mobile-html-formatted pages

Provides links to scripts and styles needed for viewing mobile-html-formatted pages offline. Stability: experimental

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final title = title_example; // String | Page title. Use underscores instead of spaces. Use percent-encoding. Example: `Main_Page`.

try {
    final result = api_instance.pageMobileHtmlOfflineResourcesTitleGet(title);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->pageMobileHtmlOfflineResourcesTitleGet: $e\n');
}

Parameters

NameTypeDescriptionNotes
titleStringPage title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.

Return type

String

Authorization

No authorization required

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

pageMobileHtmlOfflineResourcesTitleRevisionGet

String pageMobileHtmlOfflineResourcesTitleRevisionGet(title, revision)

Get styles and scripts for offline consumption of mobile-html-formatted pages

Provides links to scripts and styles needed for viewing mobile-html-formatted pages offline. Stability: experimental

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final title = title_example; // String | Page title. Use underscores instead of spaces. Use percent-encoding. Example: `Main_Page`.
final revision = 56; // int | Optional page revision. Note that older revisions are not stored, so request latency with the revision would be higher. 

try {
    final result = api_instance.pageMobileHtmlOfflineResourcesTitleRevisionGet(title, revision);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->pageMobileHtmlOfflineResourcesTitleRevisionGet: $e\n');
}

Parameters

NameTypeDescriptionNotes
titleStringPage title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.
revisionintOptional page revision. Note that older revisions are not stored, so request latency with the revision would be higher.

Return type

String

Authorization

No authorization required

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

pagePdfTitleFormatGet

String pagePdfTitleFormatGet(title, format)

Get a page as PDF

Renders the page content as PDF. Format and type are optional parameters and the default values are "a4" for format and "desktop" for type. Stability: experimental

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final title = title_example; // String | Page title. Use underscores instead of spaces. Use percent-encoding. Example: `Main_Page`.
final format = format_example; // String | PDF format

try {
    final result = api_instance.pagePdfTitleFormatGet(title, format);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->pagePdfTitleFormatGet: $e\n');
}

Parameters

NameTypeDescriptionNotes
titleStringPage title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.
formatStringPDF format

Return type

String

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/pdf, application/problem+json, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

pagePdfTitleFormatTypeGet

String pagePdfTitleFormatTypeGet(title, format, type)

Get a page as PDF

Renders the page content as PDF. Format and type are optional parameters and the default values are "a4" for format and "desktop" for type. Stability: experimental

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final title = title_example; // String | Page title. Use underscores instead of spaces. Use percent-encoding. Example: `Main_Page`.
final format = format_example; // String | PDF format
final type = type_example; // String | PDF type - `mobile` (optimized for reading on mobile devices) or `desktop` (regular PDF). `desktop` is the default render mode and it will used if param `type` is not passed

try {
    final result = api_instance.pagePdfTitleFormatTypeGet(title, format, type);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->pagePdfTitleFormatTypeGet: $e\n');
}

Parameters

NameTypeDescriptionNotes
titleStringPage title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.
formatStringPDF format
typeStringPDF type - mobile (optimized for reading on mobile devices) or desktop (regular PDF). desktop is the default render mode and it will used if param type is not passed[optional] [default to 'desktop']

Return type

String

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/pdf, application/problem+json, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

pagePdfTitleGet

String pagePdfTitleGet(title)

Get a page as PDF

Renders the page content as PDF. Format and type are optional parameters and the default values are "a4" for format and "desktop" for type. Stability: experimental

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final title = title_example; // String | Page title. Use underscores instead of spaces. Use percent-encoding. Example: `Main_Page`.

try {
    final result = api_instance.pagePdfTitleGet(title);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->pagePdfTitleGet: $e\n');
}

Parameters

NameTypeDescriptionNotes
titleStringPage title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.

Return type

String

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/pdf, application/problem+json, application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

pageRandomFormatGet

Problem pageRandomFormatGet(format)

Get content for a random page

Redirects the client to the URI for the desired format for a random page title. Stability: unstable

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final format = format_example; // String | The desired return format

try {
    final result = api_instance.pageRandomFormatGet(format);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->pageRandomFormatGet: $e\n');
}

Parameters

NameTypeDescriptionNotes
formatStringThe desired return format

Return type

Problem

Authorization

No authorization required

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

pageSegmentsTitleGet

PageSegmentsTitleGet200Response pageSegmentsTitleGet(title)

Fetches a segmented page to be used in machine translation

Use this end point to fetch the segmented content of a page. Clients should use the returned content in conjunction with the language transform API. Stability: experimental

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final title = title_example; // String | Page title. Use underscores instead of spaces. Use percent-encoding. Example: `Main_Page`.

try {
    final result = api_instance.pageSegmentsTitleGet(title);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->pageSegmentsTitleGet: $e\n');
}

Parameters

NameTypeDescriptionNotes
titleStringPage title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.

Return type

PageSegmentsTitleGet200Response

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

pageSegmentsTitleRevisionGet

PageSegmentsTitleGet200Response pageSegmentsTitleRevisionGet(title, revision)

Fetches a segmented page to be used in machine translation

Use this end point to fetch the segmented content of a page. Clients should use the returned content in conjunction with the language transform API. Stability: experimental

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final title = title_example; // String | Page title. Use underscores instead of spaces. Use percent-encoding. Example: `Main_Page`.
final revision = 56; // int | The revision id

try {
    final result = api_instance.pageSegmentsTitleRevisionGet(title, revision);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->pageSegmentsTitleRevisionGet: $e\n');
}

Parameters

NameTypeDescriptionNotes
titleStringPage title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.
revisionintThe revision id

Return type

PageSegmentsTitleGet200Response

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

pageSummaryTitleGet

Summary pageSummaryTitleGet(title, redirect, acceptLanguage)

Get basic metadata and simplified article introduction.

The summary response includes an extract of the first paragraph of the page in plain text and HTML as well as the type of page. This is useful for page previews (fka. Hovercards, aka. Popups) on the web and link previews in the apps. Stability: stable Please follow wikitech-l or mediawiki-api-announce for announcements of breaking changes.

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final title = title_example; // String | Page title. Use underscores instead of spaces. Use percent-encoding. Example: `Main_Page`.
final redirect = true; // bool | Requests for [redirect pages](https://www.mediawiki.org/wiki/Help:Redirects) return HTTP 302 with a redirect target in `Location` header and content in the body. To get a 200 response instead, supply `false` to the `redirect` parameter. 
final acceptLanguage = acceptLanguage_example; // String | The desired language variant code for wikis where LanguageConverter is enabled. Example: `sr-el` for Latin transcription of the Serbian language. 

try {
    final result = api_instance.pageSummaryTitleGet(title, redirect, acceptLanguage);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->pageSummaryTitleGet: $e\n');
}

Parameters

NameTypeDescriptionNotes
titleStringPage title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.
redirectboolRequests for redirect pages return HTTP 302 with a redirect target in Location header and content in the body. To get a 200 response instead, supply false to the redirect parameter.[optional]
acceptLanguageStringThe desired language variant code for wikis where LanguageConverter is enabled. Example: sr-el for Latin transcription of the Serbian language.[optional]

Return type

Summary

Authorization

No authorization required

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

pageTitleTitleGet

Revision pageTitleTitleGet(title)

Get revision metadata for a title.

Returns the revision metadata for the given title. If a revision ID is provided, metadata for that revision is returned, otherwise the latest revision ID is assumed. Stability: stable.

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final title = title_example; // String | Page title. Use underscores instead of spaces. Use percent-encoding. Example: `Main_Page`.

try {
    final result = api_instance.pageTitleTitleGet(title);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->pageTitleTitleGet: $e\n');
}

Parameters

NameTypeDescriptionNotes
titleStringPage title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.

Return type

Revision

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

pageTitleTitleRevisionGet

Revision pageTitleTitleRevisionGet(title, revision)

Get revision metadata for a title.

Returns the revision metadata for the given title. If a revision ID is provided, metadata for that revision is returned, otherwise the latest revision ID is assumed. Stability: stable.

Example

import 'package:wikipedia_api/api.dart';

final api_instance = PageContentApi();
final title = title_example; // String | Page title. Use underscores instead of spaces. Use percent-encoding. Example: `Main_Page`.
final revision = 56; // int | The revision id

try {
    final result = api_instance.pageTitleTitleRevisionGet(title, revision);
    print(result);
} catch (e) {
    print('Exception when calling PageContentApi->pageTitleTitleRevisionGet: $e\n');
}

Parameters

NameTypeDescriptionNotes
titleStringPage title. Use underscores instead of spaces. Use percent-encoding. Example: Main_Page.
revisionintThe revision id

Return type

Revision

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/problem+json

[Back to top] [Back to API list] [Back to Model list] [Back to README]