Wikipedia hub

Wikipedia Random Pages API

Random pages from an edition and namespace, with ids and titles.

GET /v1/wikipedia/random

1 credit Failed requests are free

About this endpoint

GET /v1/wikipedia/random?lang=en&namespace=0&limit=10 returns data.pages, one row per random page. Each row has id, ns and title. The response echoes namespace, and empty is true when the namespace has no pages.

limit is 1 to 500 and defaults to 10. Each call draws a new set, so the route is useful for sampling, smoke tests and recommendations that need an unexpected starting point. To read one of the pages in full, pass its title to the page or content route.

A namespace that exists but has no pages is lookupStatus: found with empty: true. The random set is not paginated and there is no cursor.

Wikipedia Random Pages API FAQ

Can I get more than 10 pages?

Yes, up to 500 per call. The default is 10. Each call draws a new random set, so two calls do not continue each other.

Which namespace should I use?

namespace=0 returns articles, which is the common case. Use 14 for categories or another namespace id for other page kinds. A namespace with no pages is found and empty.

Is there a cursor?

No. A random list is not paged: each request draws a fresh set. Call the route again when you need another sample.

How many credits does a random list cost?

Pricing is documented on the operation in the API registry (shown on this page). Confirm on every response with meta.creditsCharged: that field is the billing source of truth.