tw_get_item: Retrieve item from the Wikidata API and returns it as a list

View source: R/tw_get_item.R

tw_get_itemR Documentation

Retrieve item from the Wikidata API and returns it as a list

Description

Retrieve item from the Wikidata API and returns it as a list

Usage

tw_get_item(id, user_agent = tidywikidatar::tw_get_user_agent())

Arguments

id

A character vector, must start with Q, e.g. "Q180099" for the anthropologist Margaret Mead. Can also be a data frame of one row, typically generated with tw_search() or a combination of tw_search() and tw_filter_first().

user_agent

Defaults to NULL. If not given, implicitly defaults to current package name (tidywikidatar) and version.

Value

A list, with as many elements as the unique given id.

Examples

## Not run: 
  item_l <- tw_get_item(id = "Q180099")

  tidywikidatar:::tw_extract_single(w = item_l)

## End(Not run)

tidywikidatar documentation built on Feb. 10, 2026, 1:07 a.m.