TODO: Write a gem description
Add this line to your application's Gemfile:
gem 'nutritionix'
And then execute:
$ bundle
Or install it yourself as:
$ gem install nutritionix
For NXQL Supported search:
app_id = '<YOUR_APP_ID>'
app_key = '<YOUR_APP_KEY>'
provider = Nutritionix::Api_1_1.new(app_id, app_key)
search_params = {
offset: 0,
limit: 50,
fields: ['brand_id', 'brand_name', 'item_id', 'item_name', 'nf_calories'],
query: 'potato'
}
results_json = provider.nxql_search(search_params)
puts "Results: #{results_json}"
Note:
There is a standalone test script /script/test_api_1_1.rb available which can be readily used for testing.You only need to replace <YOUR_APP_ID> and <YOUR_APP_KEY> with your nutritionix app credentials.
Logs generated can be found at default location <HOME_DIRECTORY>/nutritionix_api_logs.txt
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)