Wikipedia hub

Wikipedia Search Suggestions API

Title autocomplete for a prefix, with page ids for the pages you pick.

GET /v1/wikipedia/search/suggest

1 credit Failed requests are free

About this endpoint

GET /v1/wikipedia/search/suggest?query=Albert&lang=en returns data.suggestions, one row per matching title. Each row has ns, title and pageId. The suggestion is a title that starts with the fragment, not a full-text search hit, so it is the right call for an autocomplete box or for resolving a partial title.

limit accepts 1 to 100 and defaults to 10. cursor continues with data.page.nextCursor. A fragment with no matching titles is found with empty: true.

Use the full search route when you need snippets or matches inside article text. Use this route when you need a list of titles to offer or to hydrate with the page or batch route.

Wikipedia Search Suggestions API FAQ

Is this the same as full-text search?

No. This route matches titles by prefix and returns only ns, title and pageId. The search route matches article text and returns snippets, match ranges and totals.

How many suggestions can I ask for?

From 1 to 100. The default is 10. A fragment with nothing matching is found with empty set to true, not an error.

What do I do with pageId?

Pass it nowhere: the page and batch routes take titles, not ids. Use title from the suggestion in GET /v1/wikipedia/pages/{title} or in a batch titles list.

How many credits do suggestions 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.