Description Usage Arguments Value References Examples
query_api Makes a query to the Canadian Nutrient Files API.
1 |
path |
the path to the desired endpoint. (Should be one of food, nutrientamount nutrientgroup, nutrientname, nutrientsource, refuseamount, servingsize, or yieldamount.) |
apiKey |
key to access the API. Can be retrieved from https://hc-sc.api.canada.ca/en/detail?api=cnf#!/Nutrient/get_nutrientamount.
If none is provided, @seealso |
id |
the id of what you're looking for. Meaning of the id changes depending on endpoint. |
lang |
the language you are using and want results returned in. |
a structure with the parsed text response, the raw response, the endpoint path, and the id.
Note that this function is based on, and repeats much of the code in the R API package best practices, available at https://httr.r-lib.org/articles/api-packages.html#overall-design-1.
1 2 3 4 5 6 7 8 9 10 11 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.