API and BeerXML

Discussion in 'Feature Requests' started by Tore, Aug 31, 2012.

  1. Tore

    Tore New Member

    Joined:
    Aug 31, 2012
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Oslo, Norway
    Hi,

    im a developer and i would like to access my data for my own brewing tools.
    If you could supply user with a nice (hopefully REST) API and beerXML export support we could build tools that either you haven't thought about or are too narrow to be on your roadmap in the near future.

    Simply exposing read-only brewsession and recipe access should be simple.
     
  2. LarryBrewer

    LarryBrewer Active Member

    Joined:
    Jun 27, 2012
    Messages:
    1,728
    Likes Received:
    9
    Trophy Points:
    38
    Location:
    Portland, Oregon
    How would you see the authentication working? Maybe an API token that is your account, but not your password.
     
  3. JAMC

    JAMC Member

    Joined:
    Aug 14, 2012
    Messages:
    168
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    England
    I've worked with a few APIs that use session tokens - I think most (if not all) of them require you to provide your password in order to verify your account identity and obtain a session token, which is added to the request header on the client side for subsequent requests.
     
  4. LarryBrewer

    LarryBrewer Active Member

    Joined:
    Jun 27, 2012
    Messages:
    1,728
    Likes Received:
    9
    Trophy Points:
    38
    Location:
    Portland, Oregon
    Chaps likes this.
  5. Tore

    Tore New Member

    Joined:
    Aug 31, 2012
    Messages:
    17
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Oslo, Norway
    The most secure stateless solution i know of is http://en.wikipedia.org/wiki/OAuth
    But using session keys are easier and have more examples of code and people with experience with it. Personally i have only worked on systems with session keys, but i know OAuth is on most roadmaps for those that want to integrate secure services across several devices and sites.
     
  6. LarryBrewer

    LarryBrewer Active Member

    Joined:
    Jun 27, 2012
    Messages:
    1,728
    Likes Received:
    9
    Trophy Points:
    38
    Location:
    Portland, Oregon
    Yeah I've worked with OAuth in the past. It is a beast to be sure, but it would be the best approach if you want to have another service out there that individual users can allow to talk to our services.

    We'll start with the BeerXML output, and then go from there. Public recipes would be available as BeerXML through a simple GET request such as /beerXML/{id}.
     
  7. LarryBrewer

    LarryBrewer Active Member

    Joined:
    Jun 27, 2012
    Messages:
    1,728
    Likes Received:
    9
    Trophy Points:
    38
    Location:
    Portland, Oregon
    BeerXML for public/shared recipes is now available as:
    We don't have a search recipe service, but you could parse the sitemap:
    http://www.brewersfriend.com/homebrew/sitemap.xml

    Look for links like:
    For your own recipes and data, as we create mobile apps, we will have to expose web services for those. We can leverage those into an API down the road.
     
  8. Jason Cox

    Jason Cox New Member

    Joined:
    Oct 10, 2015
    Messages:
    16
    Likes Received:
    1
    Trophy Points:
    3
    Gender:
    Male
    Occupation:
    Software Engineer
    Location:
    Washougal, Washington
    I'm also a developer. Any update on an API docs? I would like to build a few tools to better support wine.

    Thanks!
    Jason
     
  9. Bold Brews

    Bold Brews New Member

    Joined:
    Feb 26, 2017
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I'd also love a REST API feature!!
    Its a bit hard to tell from sitemap.xml which recipes are actually yours. Even after fetching the recipe itself, there isn't much to distinguish it besides the author, which might also not be unique.
     
  10. Ozarks Mountain Brew

    Staff Member

    Joined:
    Nov 20, 2012
    Messages:
    7,822
    Likes Received:
    4,068
    Trophy Points:
    113
    Gender:
    Male
    Occupation:
    IT Managment
    Location:
    The Ozark Mountains of Missouri
  11. Bold Brews

    Bold Brews New Member

    Joined:
    Feb 26, 2017
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
  12. Ozarks Mountain Brew

    Staff Member

    Joined:
    Nov 20, 2012
    Messages:
    7,822
    Likes Received:
    4,068
    Trophy Points:
    113
    Gender:
    Male
    Occupation:
    IT Managment
    Location:
    The Ozark Mountains of Missouri
    its for apps and developers to use for connection to your account, if you have a brewing app or program that asks for an api key this is it
     
  13. Bold Brews

    Bold Brews New Member

    Joined:
    Feb 26, 2017
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    im developing an app myself.. do you know how i can use this key to access my recipes and brew sessions?
     
  14. Ozarks Mountain Brew

    Staff Member

    Joined:
    Nov 20, 2012
    Messages:
    7,822
    Likes Received:
    4,068
    Trophy Points:
    113
    Gender:
    Male
    Occupation:
    IT Managment
    Location:
    The Ozark Mountains of Missouri
    I'm afraid thats up you you, Ill send a request to the developers
     
  15. Bold Brews

    Bold Brews New Member

    Joined:
    Feb 26, 2017
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Thank you for sending the request. But what do you mean by its up to me?
     
  16. Ozarks Mountain Brew

    Staff Member

    Joined:
    Nov 20, 2012
    Messages:
    7,822
    Likes Received:
    4,068
    Trophy Points:
    113
    Gender:
    Male
    Occupation:
    IT Managment
    Location:
    The Ozark Mountains of Missouri
    its up to you to know how to program the app to use an api key, it should be somewhat universal for most apps and we will not post that information to the world, you will have to talk to someone private
     
  17. vortex

    vortex New Member

    Joined:
    Nov 12, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Another dev here.. I'm just playing with brewers friend at the moment as I'm sick of beersmith (don't get me started) and looking for a web-based replacement. I dissected the beersmith "cloud" protocol to allow my brewery controller to read recipes from the cloud, though that part isn't actually running yet. I'd really like that same functionality with this.

    I'm happy to reverse the protocols manually until there's official documentation, I don't really need much info from my account.
     
  18. vortex

    vortex New Member

    Joined:
    Nov 12, 2017
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I just had a quick look at the front end, there is an authenticated REST-ish "API" (not really a true API) that is used to populate the data on the recipe edit page. Here is an example curl request to get a recipe in JSON format:
    curl 'https://www.brewersfriend.com/homebrew/recipe/json/<recipe_id>' -H 'cookie: PHPSESSID=<SESSIONID>'

    It's authenticated only, but it's trivial to authenticate with your username and password to get your PHPSESSID, then supply this as your cookie for this request. The data is returned in JSON format.
    It appears this only works to get data for your own recipes, not public recipes you don't own.
    Personally all I need from here is a method to get recipes from my own account, and thus their ID, so I can pull the information I need automatically.

    I'll have a closer look at the mobile app protocol once I buy the app.
     
  19. Vegard Vesterheim

    Vegard Vesterheim New Member

    Joined:
    Mar 10, 2015
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Is there any documentation about this API? I would like to programmatically access my recipes from my Brewersfriend account
     
  20. Ozarks Mountain Brew

    Staff Member

    Joined:
    Nov 20, 2012
    Messages:
    7,822
    Likes Received:
    4,068
    Trophy Points:
    113
    Gender:
    Male
    Occupation:
    IT Managment
    Location:
    The Ozark Mountains of Missouri
    I'm sending you a private message on the issue
     

Share This Page

arrow_white