Wikipedia

Get Wikipedia page content

Get a Wikipedia page's plain-text lead, rendered HTML or wikitext, with sections, links, categories, templates and media.

GET/v1/wikipedia/pages/{title}/content
1credit
x-api-keystringheader

API key (`sfk_...`)

Parameters
4
titlestringrequiredpath

Page title on the chosen edition, e.g. `Albert Einstein`, `C++` or `Talk:Barack Obama`. URL-encode it in the path.

langstringoptionalquery

Wikimedia edition code, e.g. `en`, `de`, `ja`, `simple` or `zh-min-nan`. Default: `en`.

formatstringoptionalquery

`text` for the plain-text lead (no lists or tables), `html` for the rendered article, `wikitext` for the source. Default: `text`.

one of: text, html, wikitext

sectionintegeroptionalquery

HTML section number to return instead of the whole article.

≥ 0 · ≤ 9999

Response fields
82

Endpoint-specific response payload.

datalookupStatus
string

Whether the entity, page or data set exists. A missing entity is `not_found`; an existing entity with no rows is `found` with `empty: true`.

one of: found, not_found

datalang
string

Edition code.

datatitle
string

Title.

dataformat
string

Format returned.

one of: text, html, wikitext

datasection
integernullable

Section number, when asked.

datapageId
integernullable

Page id.

datarevisionId
integernullable

Revision id.

datadisplayTitle
stringnullable

Title with display markup.

The content in the requested form; the other fields are null.

datacontenttext
stringnullable

Plain text, for `format=text`.

datacontenthtml
stringnullable

HTML, for `format=html`.

datacontentwikitext
stringnullable

Wikitext, for `format=wikitext`.

Content licence. Text and HTML use the edition's fixed CC BY-SA 4.0 notice; wikitext uses the notice the core REST answer carries.

datalicensename
stringnullable

Licence name.

datalicenseurl
stringnullable

Licence URL.

Revision the content belongs to.

datalatestid
integernullable

Revision id.

datalatesttimestamp
stringnullable

When it was saved.

dataredirectTarget
stringnullable

Resolved title of the redirect, on `format=wikitext`.

dataredirectedFrom
stringnullableoptional

The title asked for when it redirected to the returned page.

Section headings of the rendered page.

datasections[]tocLevel
integernullable

Depth in the table of contents.

datasections[]level
stringnullable

Heading level.

datasections[]line
stringnullable

Heading text.

datasections[]number
stringnullable

Section number.

datasections[]index
stringnullable

Section index.

datasections[]fromTitle
stringnullable

Title the section belongs to.

datasections[]byteOffset
integernullable

Offset in the wikitext.

datasections[]anchor
stringnullable

Anchor.

datasections[]linkAnchor
stringnullable

Link anchor.

Categories of the rendered page.

datacategories[]category
string

Category name without the namespace.

datacategories[]sortKey
stringnullable

Sort key.

datacategories[]hidden
booleannullable

Whether the category is hidden.

Other editions of the rendered page.

datalanguageLinks[]lang
string

Edition code.

datalanguageLinks[]url
stringnullable

URL in that edition.

datalanguageLinks[]languageName
stringnullable

Language name.

datalanguageLinks[]autonym
stringnullable

Language name in itself.

datalanguageLinks[]title
stringnullable

Title.

Templates, when the answer carries them.

datatemplates[]ns
integernullable

Namespace id.

datatemplates[]title
stringnullable

Linked title.

datatemplates[]exists
booleannullable

Whether the target page exists.

datatemplates[]url
stringnullable

External URL.

datatemplates[]prefix
stringnullable

Interwiki prefix.

datatemplates[]sortKeyPrefix
stringnullable

Human-readable category sort key.

datatemplates[]timestamp
stringnullable

When the page joined the category.

datatemplates[]hidden
booleannullable

Whether the category is hidden.

Image file names, when carried.

dataimages[]
stringoptional

External URLs, when the answer carries them.

dataexternalLinks[]
stringoptional

Interwiki links, when the answer carries them.

datainterwikiLinks[]ns
integernullable

Namespace id.

datainterwikiLinks[]title
stringnullable

Linked title.

datainterwikiLinks[]exists
booleannullable

Whether the target page exists.

datainterwikiLinks[]url
stringnullable

External URL.

datainterwikiLinks[]prefix
stringnullable

Interwiki prefix.

datainterwikiLinks[]sortKeyPrefix
stringnullable

Human-readable category sort key.

datainterwikiLinks[]timestamp
stringnullable

When the page joined the category.

datainterwikiLinks[]hidden
booleannullable

Whether the category is hidden.

Internal links, when the answer carries them.

datalinks[]ns
integernullable

Namespace id.

datalinks[]title
stringnullable

Linked title.

datalinks[]exists
booleannullable

Whether the target page exists.

datalinks[]url
stringnullable

External URL.

datalinks[]prefix
stringnullable

Interwiki prefix.

datalinks[]sortKeyPrefix
stringnullable

Human-readable category sort key.

datalinks[]timestamp
stringnullable

When the page joined the category.

datalinks[]hidden
booleannullable

Whether the category is hidden.

dataproperties
objectnullable

Page properties the rendered page reports.

Warnings the rendered page reports.

dataparseWarnings[]
stringoptional

Redirects followed while rendering.

dataredirects[]
objectoptional
dataempty
boolean

Whether the answer is a valid empty result rather than missing.

Metadata describing the request and billing outcome.

metarequestId
string

Unique request identifier for tracing this API call.

min 1 chars

metacreditsCharged
integer

Credits charged for this request.

≥ 0

metaversion
string

Public API version that served the response.

one of: v1

Code example

curl "https://api.socialfetch.dev/v1/wikipedia/pages/Albert%20Einstein/content?format=text" \
  -H "x-api-key: YOUR_API_KEY"

Responses

Get Wikipedia page content