Java Library for the Food2Fork API
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.
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");
Get a Recipe object by id.
(input)
Recipe recipe = api.getRecipe("29159");
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);
This library can be used for commerical and non-commerical purposes in compliance with the guidelines set forth by Food2Fork.