csfd_search | R Documentation |
Search pages on CSFD.
use csfd_search_titles()
to search for titles
use csfd_search_creators()
to search for creators
use csfd_search_ranks()
to search rankings
use csfd_search_options()
to review search parameters
csfd_search_titles( type = NULL, additional = NULL, genre = NULL, origin = NULL, released = NULL, rating = NULL, fields = NULL, page = 1, sort = c("rated", "rating_average", "rating_average_asc", "fanclub_count", "year", "year_asc"), quiet = FALSE ) csfd_search_creators( type = NULL, additional = NULL, born = NULL, born_in = NULL, died = NULL, died_in = NULL, gender = NULL, page = 1, sort = c("fanclub_count", "birth_date_asc", "birth_date"), quiet = FALSE ) csfd_search_ranks( type = NULL, origin = NULL, released = NULL, actor = NULL, director = NULL, genre = NULL, page = 1, quiet = FALSE ) csfd_search_options(domain, element, choices = Inf, single = FALSE)
type, additional |
A vector of checkbox names/dropdown options. |
genre, origin |
For For
If you use either
|
released, rating |
A vector of 1 to 2 integers (or
|
fields |
A named list of numerical identifiers. Examples:
|
page |
Which page to retrieve. |
sort |
How to sort results. |
quiet |
If |
born, died |
A vector of date strings. Examples:
|
born_in, died_in |
A single country name. |
gender |
One of: |
actor, director |
A vector of integer identifiers, obtained from creator's page URL. |
domain, element, choices |
Useful for displaying options for search forms. Example:
|
single |
If |
An object of class csfd_scraper or, in case of csfd_search_options()
,
a list.
The result of the search call is a csfd_scraper object with two items:
results
: A data frame with search results, including unique identifier.
paginator
: A data frame with next_url
column, which redirects
to the next page of results; if a missing value, it indicates there are
no more results.
## Not run: # Search for films and TV shows made in the US only, either drama or sci-fi # (and possibly other things except horror), rated at least 80 and made # between 2000 and 2022 (included). re <- csfd_search_titles( type = c("film", "tv_show"), origin = list(exact = "USA"), genre = list(any = c("Drama", "Sci-Fi"), not = c("horor")), rating = 80, released = c(2000, 2022) ) re$results # As there are more results than would fit a single page, retrieve the next # page URL and use csfd_fetch() to get those. re$paginator$next_url %>% csfd_fetch() # Search rankings of movies filmed in Asia between 1980-2022, starring Donnie # Yen and Michelle Yeoh. re <- csfd_search_ranks( type = "film", origin = "Asie", released = c(1980, 2022), # This vector does not have to be named, but it's nice for clarity. actor = c("Donnie Yen" = 39, "Michelle Yeoh" = 1818), genre = "Akční" ) re$results ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.