| genderapi_batch | R Documentation |
Sends one POST /gender/batch request with {"items": [...]}. Batch
items default to ai_mode = "off" on the server. The server decides the
limit (50 items; 10 on the IP trial). Larger jobs must be split by the
caller; the package never retries or splits automatically.
genderapi_batch(items, client = genderapi_client())
items |
The items: a list of |
client |
A |
A partially successful batch is returned normally (HTTP 200): inspect
every item. Each item has index, the optional id, charged_credits
and exactly one of data (a prediction) or error (a problem with
code). meta$summary has total, succeeded, identified, unknown
and failed. When every executed item fails the API answers with an
error status; the resulting genderapi_http_error keeps the item array in
data.
Retry only failed items, and only once billing is confirmed: resubmitting successful items charges them again.
A genderapi_batch: the parsed V2 JSON with data (the item
list) and meta (including summary and usage). Use
as.data.frame() for one row per item and genderapi_failed() for the
failed items.
items <- list(
genderapi_item("name", "Onur", country = "TR", id = "a"),
genderapi_item("email", "alex@example.com", id = "b")
)
## Not run:
# Sends a request and may consume credits.
res <- genderapi_batch(items)
res$meta$summary
as.data.frame(res)
genderapi_failed(res)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.