Project

food2fork

0.0
No commit activity in last 3 years
No release in over 3 years
A Ruby gem for accessing the Food2Fork api
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

= 0.13.5, ~> 0
 Project Readme

Food2Fork

A gem for accessing the Food2Fork API

Installation

Add this line to your application's Gemfile:

gem 'food2fork'

And then execute:

$ bundle

Or install it yourself as:

$ gem install food2fork

Usage

Examples

authentication

All requests require a valid API key. For a free api key please apply here

# set FOOD2FORK_API_KEY as environment variable
export FOOD2FORK_API_KEY=52e595d8dff202904d....

All parameters can be encoded as either HTTP GET or POST parameters.

Recipes search api

Food2Fork::Recipe.search # => returns list of Recipe array object

Recipe search parameters

  • q: (optional) Search Query (Ingredients should be separated by commas). If this is omitted top rated recipes will be returned.
  • sort: (optional) How the results should be sorted. See Below for details.
  • page: (optional) Used to get additional results
Food2Fork::Recipe.search({q: 'Paneer', sort: 'r', page: 3}) # => returns list of Recipe array object

Get Recipe

  • rId: (integer,optional) - Id of desired recipe as returned by Search Query
Food2Fork::Recipe.get({rId: 47024}) # => returns recipe object

Search Sorting

The Food2Fork API offers two kinds of sorting for queries. The first is by rating. This rating is based off of social media scores to determine the best recipes.

sort=r

The second is by trendingness. The most recent recipes from our publishers have a trend score based on how quickly they are gaining popularity.

sort=t

Pages (Search Only)

Any request will return a maximum of 30 results. To get the next set of results send the same request again but with

page = 2 

The default if omitted is

page = 1

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Let’s build something great:

We’d love to design & build your next big idea, or lend a hand on an existing project.

Email - contact@7precisions.com
Website - http://7precisions.com

alt tag