% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/players.R
\name{wta_get_player_basics}
\alias{wta_get_player_basics}
\title{Get basic bio for a WTA player}
\usage{
wta_get_player_basics(player_url, download_images = TRUE)
}
\arguments{
\item{player_url}{Character. Full URL to a player page. Build it with
\code{\link[=wta_player_url]{wta_player_url()}} if you only have the numeric id.}

\item{download_images}{Logical. When \code{TRUE} (default) the headshot is
downloaded into a \code{magick-image} object. Set to \code{FALSE} to skip the
network round-trip and return only the image URL.}
}
\value{
A one-row \code{\link[tibble:tibble]{tibble::tibble()}} with columns:
\describe{
\item{\code{player_id}}{Numeric WTA id parsed from \verb{@id}.}
\item{\code{name}, \code{given_name}, \code{family_name}}{Name fields.}
\item{\code{birth_date}}{Date of birth (ISO 8601 character).}
\item{\code{nationality}, \code{birth_place}, \code{birth_country}}{Geography fields.}
\item{\code{height}}{Height string as shown on the bio (e.g. \verb{5' 9" (1.74m)}).}
\item{\code{handedness}}{Dominant hand (\code{"Right-Handed"} / \code{"Left-Handed"}).}
\item{\code{nationality_code}}{3-letter IOC/ISO code extracted from the flag
image (e.g. \code{"CZE"}, \code{"USA"}).}
\item{\code{player_image_url}, \code{nationality_flag_url}}{Headshot and flag URLs.}
\item{\code{player_image}}{\code{magick-image} of the headshot, when
\code{download_images = TRUE}.}
\item{\code{nationality_flag}}{\code{magick-image} of the flag SVG, when
\code{download_images = TRUE} and the suggested package \pkg{rsvg} is
installed (otherwise \code{NA}).}
}
}
\description{
Parses the profile header of a WTA player page and returns a one-row
tibble with name, nationality, birth date, birth place, height and
handedness. The bulk of the data is read from the page's JSON-LD
(schema.org Person) block, which is more stable than the visual markup;
height is read from the profile bio block as a fallback.
}
\examples{
\dontshow{if (interactive()) withAutoprint(\{ # examplesIf}
wta_get_player_basics(wta_player_url(320301, "katerina-siniakova"))
\dontshow{\}) # examplesIf}
}
