API Documentation


Updates:


The RateBeer API provides the following:
  • Searching beers by beer name
  • Searching for beers by beerID
  • Retrieving beer reviews by beerID
  • Retrieving a list of top beers

  • Click here to request an access key.

    Documentation:


    Available Environments


    There are two environments to connect to, a sandbox environment accesible at:
    1. The "sandbox" environment, which is an old copy of the production envirionment and is useful for this testing purposes.
    https://api-qa.ratebeer.com/v1/api/graphql

    2. The production environment that is linked to the live data available on www.ratebeer.com:
    https://api.ratebeer.com/v1/api/graphql

    Example:


    This example runs a curl command from a bash shell, and connects to the sandbox endpoint.
    curl -v 'https://api-qa.ratebeer.com/v1/api/graphql' \
    -H 'content-type: application/json' \
    -H 'accept: application/json' \
    -H 'x-api-key: ' \
    --data-binary '{"query":"query {\n beer(id: 4934) {\n id\n name\n }\n}","variables":"{}","operationName":null}'

    It provides 3 headers:
     1. content-type with a value of 'application/json' to indicate that the body uses the JSON format.
     2. accept with a value of 'application/json' to indicate we're expecting JSON format in response.
     3. x-api-key the value for which you'll need to supply the API Key you've received.

    The body which is written in GraphQL requests the name of the beer which has an id of 4934:

    query {
     beer(id: 4934) {
      name
     }
    }


    The response body of this example should return the following JSON:
    {"data":{"beer":{"id":"4934","name":"Westvleteren 12 (XII)"}}}

    Here are the various queries that the API currently accepts:
    beer
     takes { id }
     returns { id, name, brewer, abv, styleScore, ratingCount, style, imageURL }

    topBeers
     takes { first }
     returns { items, totalCount, last }

    beerSearch
     takes { query, first, after }
     returns { items, totalCount, last }

    Usage limitations


     5,000 Requests / Month
     1 Request / Second

    GraphQL documentation

    For information on GraphQL please see these resources:
     1. Introduction to GraphQL
     2. GraphQL by Facebook