Wikipedia

List random Wikipedia pages

List random pages in a Wikipedia edition and namespace.

GET/v1/wikipedia/random
1credit
x-api-keystringheader

API key (`sfk_...`)

Parameters
3
langstringquery

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

namespaceintegerquery

Namespace id, e.g. `0` for articles or `14` for categories.

≥ -2 · ≤ 999

limitintegerquery

Pages to return, 1 to 500. Default: 10.

≥ 1 · ≤ 500

Response fields
13

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.

datanamespace
integernullable

Namespace filter.

Random pages in the requested namespace.

datapages[]id
integer

Page id.

datapages[]ns
integer

Namespace id.

datapages[]title
string

Title.

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/random?limit=5" \
  -H "x-api-key: YOUR_API_KEY"

Responses

List random Wikipedia pages