Wikipedia hub

Wikipedia Links API

Internal links, external URLs, templates, categories or interwiki links for one page.

GET /v1/wikipedia/pages/{title}/links

1 credit Failed requests are free

About this endpoint

GET /v1/wikipedia/pages/{title}/links?type=internal returns data.links for one link kind. type is internal (the default), external, templates, categories or interwiki.

The row shape depends on the type. Internal links and templates fill ns, title and exists. External links fill url. Categories add sortKeyPrefix, timestamp and hidden; the raw collation key is not exposed. Interwiki links fill prefix, title and url. Fields that do not apply are null.

limit accepts 1 to 500 rows and cursor continues with data.page.nextCursor. A found page with no links of the chosen kind is found with empty: true; a missing title is not_found.

Wikipedia Links API FAQ

How do I get external URLs?

Set type=external. Each row has the url field and the other link fields are null. Use type=internal for links to other pages on the same edition.

Why do category rows have extra fields?

Categories carry a human-readable sort key prefix, the time the page joined the category, and a hidden flag. The raw collation key is not exposed. Those fields are null on other link types.

Can a page have no links of one kind?

Yes. A page with no external links, or a page whose categories list is empty, is found with empty set to true. The page itself still exists.

How is link paging billed?

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. Each paginated page is a separate billed request.