Wikipedia

Search Wikidata

Search Wikidata entities by label, alias or description.

GET/v1/wikipedia/wikidata/search
1credit
x-api-keystringheader

API key (`sfk_...`)

Parameters
5
querystringrequiredquery

Text to search for.

min 1 chars · max 300 chars

langstringoptionalquery

Edition code for labels, aliases and descriptions. Default: `en`.

typestringoptionalquery

Entity type to search: `item` (default), `property`, `lexeme`, `form` or `sense`.

pattern: ^[a-z]{2,20}$

limitintegeroptionalquery

Results per page, 1 to 50. Default: 50. The walk stops at 100 results in total.

≥ 1 · ≤ 50

cursorstringoptionalquery

Cursor from `page.nextCursor` of the previous response. It only works with the same filters.

min 1 chars · max 2048 chars

Response fields
35

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 searched.

dataquery
string

The search text.

datatype
string

Entity type searched.

Entity hits in this page.

dataresults[]id
string

Entity id.

dataresults[]title
string

Entity title, usually the id.

dataresults[]pageId
integernullable

Wikidata page id.

dataresults[]conceptUri
stringnullable

Concept URI.

dataresults[]repository
stringnullable

Repository, e.g. `wikidata`.

dataresults[]url
stringnullable

Absolute entity URL.

Label and description as displayed.

A label or description in one language.

dataresults[]displaylabellanguage
string

Language code.

dataresults[]displaylabelvalue
string

Text in that language.

A label or description in one language.

dataresults[]displaydescriptionlanguage
string

Language code.

dataresults[]displaydescriptionvalue
string

Text in that language.

dataresults[]label
stringnullable

Matched label.

dataresults[]description
stringnullable

Matched description.

What the query matched.

dataresults[]matchtype
stringnullable

What matched, e.g. `label`.

dataresults[]matchlanguage
stringnullable

Language of the match.

dataresults[]matchtext
stringnullable

Matched text.

Matched aliases.

dataresults[]aliases[]
stringoptional

Pagination state. `nextCursor` is null on the last page.

datapagehasMore
boolean

Whether another page is available.

datapagenextCursor
stringnullable

Cursor to pass in the next request when more pages exist; null on the last page.

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/wikidata/search?query=einstein" \
  -H "x-api-key: YOUR_API_KEY"

Responses

Search Wikidata