Skip to content

frankenbeanies/jfood2fork

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

jfood2fork

Java Library for the Food2Fork API

Installation

Either download the latest stable release, or clone and compile the repository. This project is dependent on genson which will need to be downloaded if you choose to compile the library yourself.

Usage

Food2Fork(string apiKey)

Simply create a new Food2Fork object, passing your API Key to the constructor. You can get an API Key at Food2Fork's API Portal

Food2Fork api = new Food2Fork("YOUR_API_KEY_HERE");

Food2Fork.getRecipe(String id)

Get a Recipe object by id.

(input)

Recipe recipe = api.getRecipe("29159");

Food2Fork.search(String query, char sort, int page)

Get a list of recipes by querying the Food2Fork database. Each query returns a maximum of thirty results.

query - Your search terms

sort - How to sort the results. 'r' sorts by rating, 't' sorts by trending.

page - Each requests returns a maximum of 30 results. In order to get more, increment the page parameter.

SearchResults results = api.search("Ham and Cheese", 'r', 2);

License

This library can be used for commerical and non-commerical purposes in compliance with the guidelines set forth by Food2Fork.