Title: | An Interface to the 'Ravelry' API |
---|---|
Description: | Provides access to the 'Ravelry' API <https://www.ravelry.com/groups/ravelry-api>. An R wrapper for pulling data from 'Ravelry.com', an organizational tool for crocheters, knitters, spinners, and weavers. You can retrieve pattern, yarn, author, and shop information by search or by a given id. |
Authors: | Kaylin Pavlik [aut, cre] |
Maintainer: | Kaylin Pavlik <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2025-02-22 03:24:31 UTC |
Source: | https://github.com/walkerkq/ravelry |
This function retrieves details for a designer using their id.
get_designer(id)
get_designer(id)
id |
designer id |
tibble with name, notes, count of patterns, etc.
## Not run: get_designer(id = 1)
## Not run: get_designer(id = 1)
This function retrieves pattern categories.
get_pattern_categories()
get_pattern_categories()
nested tibble containing levels of categories and sub-categories for patterns.
## Not run: get_pattern_categories()
## Not run: get_pattern_categories()
This function retrieves details for one or multiple patterns using the pattern id.
get_patterns(ids)
get_patterns(ids)
ids |
one or more 'pattern_id's. Tested for vectors of up to 500 ids; 100 max recommended. |
tibble containing pattern details, like yardage, gauge, count of comments, ratings, etc.
## Not run: get_patterns(ids = c(600, 601))
## Not run: get_patterns(ids = c(600, 601))
This function retrieves details for a shop using its id.
get_shop(id)
get_shop(id)
id |
shop id |
tibble containing shop info including address, contact info, and other descriptive variables.
## Not run: get_shop(id = 1781)
## Not run: get_shop(id = 1781)
This function retrieves yarn attribute groups.
get_yarn_attribute_groups()
get_yarn_attribute_groups()
tibble containing current attribute groups for yarn.
## Not run: get_yarn_attribute_groups()
## Not run: get_yarn_attribute_groups()
This function retrieves details for one or multiple yarns using the yarn id.
get_yarns(ids)
get_yarns(ids)
ids |
one or more 'yarn_id's |
tibble containing yarn details like company, gauge, grams, texture, needle sizes, ratings, etc.
## Not run: get_yarns(ids = c(66124,54110))
## Not run: get_yarns(ids = c(66124,54110))
The API wrapper functions in this package rely on basic authentication via username
and password residing in the environment variables RAVELRY_USERNAME
and
RAVELRY_PASSWORD
. The easiest way to accomplish this is to set it in
the '.Renviron
' file in your home directory. If you do not have these
credentials, you can create them at https://www.ravelry.com/pro/developer.
ravelry_auth(key = "username", overwrite = FALSE)
ravelry_auth(key = "username", overwrite = FALSE)
key |
the variable to set - either username or password |
overwrite |
overwrite the existing variable in the current environment? |
atomic character vector containing the username or password credential
This function is the base GET call to the Ravelry API.
ravelry_get(path, query = NULL)
ravelry_get(path, query = NULL)
path |
the API method to call |
query |
call parameters in the form of a list() |
API object
This function retrieves groups based on search terms.
search_groups(query = NULL, page = NULL, page_size = NULL, sort = NULL, ...)
search_groups(query = NULL, page = NULL, page_size = NULL, sort = NULL, ...)
query |
search string |
page |
result page to retrieve; defaults to first page |
page_size |
number of results to retrieve; defaults to 50 |
sort |
options: 'best', 'added', 'favorites' |
... |
pass any other filter parameters available via https://www.ravelry.com/groups/search (ex. creation, gc) |
tibble containing group information, like name, created_at, short_description, etc.
## Not run: search_groups(query = 'star wars') # with site search parameters ## Not run: search_groups(query = 'star wars', gc = 'knitting')
## Not run: search_groups(query = 'star wars') # with site search parameters ## Not run: search_groups(query = 'star wars', gc = 'knitting')
This function retrieves a list of pattern ids and basic details based on search terms.
search_patterns(query = NULL, page = NULL, page_size = NULL, ...)
search_patterns(query = NULL, page = NULL, page_size = NULL, ...)
query |
search string |
page |
result page to retrieve; defaults to first page |
page_size |
number of results to retrieve; defaults to 100 |
... |
pass any other filter parameters available via https://www.ravelry.com/patterns/search (ex. craft, availability, photo, pa, fit, weight, etc.) |
tibble containing basic pattern details, some nested
## Not run: search_patterns(query = 'cowl') # with site search parameters ## Not run: search_patterns(query = 'hat', page_size = 10, availability = 'free', fit = 'baby')
## Not run: search_patterns(query = 'cowl') # with site search parameters ## Not run: search_patterns(query = 'hat', page_size = 10, availability = 'free', fit = 'baby')
This function retrieves shops based on search terms.
search_shops(query = NULL, shop_type_id = NULL, lat = NULL, lng = NULL, radius = NULL, units = NULL, page = NULL, page_size = NULL, sort = NULL)
search_shops(query = NULL, shop_type_id = NULL, lat = NULL, lng = NULL, radius = NULL, units = NULL, page = NULL, page_size = NULL, sort = NULL)
query |
search string |
shop_type_id |
set to 1 to restrict to local stores only (filter out chains and online stores) |
lat |
latitude for geographic search |
lng |
longitude for geographic search |
radius |
radius for geographic search |
units |
units for geographic search, 'miles' or 'km' |
page |
result page to retrieve; defaults to 1 |
page_size |
number of results to retrieve; defaults to 100 |
sort |
options: 'best', 'added', 'favorites' |
tibble with address, social media, and other descriptive features for shops
## Not run: search_shops(lat = 42.35, lng = -71.05, radius = 100)
## Not run: search_shops(lat = 42.35, lng = -71.05, radius = 100)
This function retrieves a list of basic yarn details based on search terms.
search_yarn(query = NULL, page = NULL, page_size = NULL, sort = NULL, ...)
search_yarn(query = NULL, page = NULL, page_size = NULL, sort = NULL, ...)
query |
search string |
page |
result page to retrieve; defaults to first page |
page_size |
number of results to retrieve; defaults to 100 |
sort |
options: 'best', 'rating', 'projects' |
... |
pass any other filter parameters available via https://www.ravelry.com/yarns/search (ex. weight, needles, photo, fiberc, ya, ratings, origin) |
tibble containing basic pattern details, some nested
## Not run: search_yarn(query = 'cascade', page_size = 10) # using site search parameters ## Not run: search_yarn(query = 'cascade', sort = 'best', weight = 'sport', needles = '3.75mm')
## Not run: search_yarn(query = 'cascade', page_size = 10) # using site search parameters ## Not run: search_yarn(query = 'cascade', sort = 'best', weight = 'sport', needles = '3.75mm')
This function retrieves yarn companies based on search terms.
search_yarn_companies(query = NULL, page = NULL, page_size = NULL, sort = NULL, ...)
search_yarn_companies(query = NULL, page = NULL, page_size = NULL, sort = NULL, ...)
query |
search string |
page |
result page to retrieve; defaults to first page |
page_size |
number of results to retrieve; defaults to 48 |
sort |
options: 'best' |
... |
pass any other filter parameters available via https://www.ravelry.com/yarns/brands/search |
tibble containing company details
## Not run: search_yarn_companies(query = 'lion')
## Not run: search_yarn_companies(query = 'lion')