Search Wikipedia
Search a Wikipedia edition, with snippets, match ranges, totals and suggestions.
Headers
Get your API keyAPI key (`sfk_...`)
Search text. Operators such as `insource:`, `incategory:` and `intitle:` work. A plain `insource:/.../` regular expression can be slow; prefer words or `insource:"..."`. At most 300 characters.
min 1 chars · max 300 chars
Wikimedia edition code, e.g. `en`, `de`, `ja`, `simple` or `zh-min-nan`. Default: `en`.
Results per page, 1 to 500. Default: 50.
≥ 1 · ≤ 500
First result to return, 0 to 9999. Use `cursor` to continue a walk.
≥ 0 · ≤ 9999
Result order: relevance (default), create_timestamp, incoming_links, last_edit, title_natural, just_match, none or random, optionally with `_asc` or `_desc`.
pattern: ^(relevance|create_timestamp|incoming_links|last_edit|title_natural|just_match|none|random)(?:_(asc|desc))?$
Namespace id, e.g. `0` for articles or `14` for categories.
≥ -2 · ≤ 999
Cursor from `page.nextCursor` of the previous response. It only works with the same filters. Rankings can shift between pages, so a title can repeat at a page boundary; de-duplicate by `pageId`.
min 1 chars · max 2048 chars
Endpoint-specific response payload.
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
Edition code.
The search text.
Total matches.
≥ 0
A suggested spelling, when the search offers one.
The query as the edition rewrote it, when it did.
First result in this page.
≥ 0
Search hits in this page.
Page id.
Namespace id.
Title.
Page size in bytes.
Word count.
Last edit, ISO 8601.
Snippet with the search markup removed.
Where the query matched in the snippet.
Start offset in `snippet`.
≥ 0
End offset in `snippet`.
≥ 0
Matched text.
Title snippet, plain.
Matched section title.
Matched redirect title.
Matched category snippet.
Pagination state. `nextCursor` is null on the last page.
Whether another page is available.
Cursor to pass in the next request when more pages exist; null on the last page.
True when the walk stopped at the 9999-result ceiling instead of at the last result.
Whether the answer is a valid empty result rather than missing.
Metadata describing the request and billing outcome.
Unique request identifier for tracing this API call.
min 1 chars
Credits charged for this request.
≥ 0
Public API version that served the response.
one of: v1
Code example
curl "https://api.socialfetch.dev/v1/wikipedia/search?query=einstein" \
-H "x-api-key: YOUR_API_KEY"Responses
Search Wikipedia