JSON Recipe API incomplete

Discussion in 'Feature Requests' started by Vito, Jun 17, 2020.

  1. Vito

    Vito New Member

    Joined:
    Sep 13, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    The API
    https://api.brewersfriend.com/v1/recipes/:recipe_id

    returns only recipe summary. There is no fermentable, hops, mash steps, and etc.

    BeerXML API
    https://api.brewersfriend.com/v1/recipes/:recipe_id.xml
    does include the necessary information.

    I am developing a brew controller and want to import recipes from brewersfriend.com without exporting them into BeerXML first. The processor of the controller is not powerful enough to do HTTPS, so I designed to make the browsers fetch the recipes. The problem is Same-Origin policy. Unless CORS is supported by brewersfriend.com, JSON is the only way to go. However, lake of necessary and important information makes the JSON API useless.

    Please complete the JSON recipe response.
     
  2. Pricelessbrewing

    Pricelessbrewing QA Software Tester
    Staff Member

    Joined:
    Jun 8, 2016
    Messages:
    766
    Likes Received:
    503
    Trophy Points:
    93
    Gender:
    Male
    I'll page one of our developers, @avantassel to take a look.
     
  3. avantassel

    avantassel Moderator
    Staff Member

    Joined:
    Jan 5, 2018
    Messages:
    148
    Likes Received:
    90
    Trophy Points:
    28
    Gender:
    Male
    Occupation:
    Brewer and Software Engineer
    Location:
    Lafayette, CO
    Home Page:
    Yes, we can add this to the recipes endpoint json response.
     
  4. Pricelessbrewing

    Pricelessbrewing QA Software Tester
    Staff Member

    Joined:
    Jun 8, 2016
    Messages:
    766
    Likes Received:
    503
    Trophy Points:
    93
    Gender:
    Male
    Thanks @avantassel!

    @Vito, I've created a ticket for the request. There are a few things that are more pressing so I can't say when this will be completed due to prioritizations. Once we get to this, and it moves to beta, and then gets released I will comment on this thread so you're up to day.
     
  5. Mark Farrall

    Mark Farrall Well-Known Member

    Joined:
    Oct 19, 2017
    Messages:
    1,303
    Likes Received:
    1,424
    Trophy Points:
    113
    Location:
    Melbourne Australia
    Any thoughts about loosening up the CORS protection? I've had a couple of ideas for status pages that could be front end only if the CORS protection was disabled, but need a server with the current configuration. Not that I'm saying it should be, it is a big can of worms to open.

    Maybe subscribers can nominate URLs for exceptions through the integrations page?
     
  6. jeb2

    jeb2 New Member

    Joined:
    Dec 23, 2014
    Messages:
    3
    Likes Received:
    2
    Trophy Points:
    3
    Good evening! Has there been any movement on this request to update the recipes endpoint JSON response? I too really need to have my fermentables, yeast, hops, and other ingredients included with the other recipe data currently available. Thank you for the great work being done to make BF the best brewing software.
     
    Pricelessbrewing likes this.
  7. Pricelessbrewing

    Pricelessbrewing QA Software Tester
    Staff Member

    Joined:
    Jun 8, 2016
    Messages:
    766
    Likes Received:
    503
    Trophy Points:
    93
    Gender:
    Male
    Thanks for the followup, there is a pending update to expand the recipe API to include ingredients that is undergoing testing. Hope to release soon!
     
  8. jeb2

    jeb2 New Member

    Joined:
    Dec 23, 2014
    Messages:
    3
    Likes Received:
    2
    Trophy Points:
    3
    I just added the new ingredient parameter to my query, and it works great! Thank you very much. Is it possible to allow the default limit=20 when using the ingredient parameter to be reset using the limit parameter in a future update? I have 103 recipes, some are revisions the same brew, and I am just getting started. I would like to be able to track the evolution of ingredients relative to tasting notes, and the limit=20 makes that very difficult. As an interim fix, is it possible to select first 20, second 20, etc., using the existing query parameters, so I can programmatically extract ingredients for all recipes?
     
    Pricelessbrewing likes this.
  9. Pricelessbrewing

    Pricelessbrewing QA Software Tester
    Staff Member

    Joined:
    Jun 8, 2016
    Messages:
    766
    Likes Received:
    503
    Trophy Points:
    93
    Gender:
    Male
    I haven't used the API's that much, so I will reach out to one of the developers and ask them reply here.
     
  10. avantassel

    avantassel Moderator
    Staff Member

    Joined:
    Jan 5, 2018
    Messages:
    148
    Likes Received:
    90
    Trophy Points:
    28
    Gender:
    Male
    Occupation:
    Brewer and Software Engineer
    Location:
    Lafayette, CO
    Home Page:
    Yes you will use the offset parameter, so
    limit=20, offset=0 then limit=20, offset=20 (to get the next 20 - 40)
     
    Pricelessbrewing likes this.
  11. Pricelessbrewing

    Pricelessbrewing QA Software Tester
    Staff Member

    Joined:
    Jun 8, 2016
    Messages:
    766
    Likes Received:
    503
    Trophy Points:
    93
    Gender:
    Male
    Thanks for the quick followup @avantassel
     
  12. jeb2

    jeb2 New Member

    Joined:
    Dec 23, 2014
    Messages:
    3
    Likes Received:
    2
    Trophy Points:
    3
    Thank you very much!
     

Share This Page

arrow_white