Skip to content

Quick Start

Get up and running with the LCBO.dev GraphQL API in 5 minutes.

API Endpoint

https://api.lcbo.dev/graphql

All queries are sent via HTTP POST with a JSON body.

Terms of Service

By using the LCBO.dev API, you agree to our Terms of Service.

Your First Query

Let's fetch some products. Copy this into your terminal:

bash
curl -X POST https://api.lcbo.dev/graphql \
  -H "Content-Type: application/json" \
  -d '{
    "query": "{ products(pagination: { first: 5 }) { edges { node { sku name priceInCents producerName } } } }"
  }'

You should see JSON with 5 products!

In JavaScript

Here's the same query in JavaScript:

javascript
const query = `
  query {
    products(pagination: { first: 5 }) {
      edges {
        node {
          sku
          name
          priceInCents
          producerName
        }
      }
    }
  }
`;

fetch('https://api.lcbo.dev/graphql', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ query }),
})
  .then(res => res.json())
  .then(data => console.log(data.data.products));

Run this in your browser console or Node.js - no API key needed!

Production-Ready Setup

This example uses fetch for simplicity. For production apps, we recommend using a GraphQL client like urql or Apollo Client for better caching, error handling, and developer experience. See our Build a Product Finder tutorial to learn how to set up urql in a React app.

Common Queries

Get a Specific Product

graphql
query {
  product(sku: "438663") {
    name
    priceInCents
    producerName
    origin
    alcoholPercent
  }
}

Search Products

graphql
query {
  products(
    filters: { search: "corona" }
    pagination: { first: 10 }
  ) {
    edges {
      node {
        sku
        name
        priceInCents
      }
    }
  }
}

Find Nearby Stores

graphql
query {
  stores(
    filters: {
      latitude: 43.6532
      longitude: -79.3832
      radiusKm: 10
    }
    pagination: { first: 5 }
  ) {
    edges {
      node {
        name
        address
        city
        distanceKm
      }
    }
  }
}

Check Product Availability

graphql
query {
  product(sku: "438663") {
    name
    priceInCents
    inventories(
      filters: {
        latitude: 43.6532
        longitude: -79.3832
        radiusKm: 20
        minQuantity: 1
      }
      pagination: { first: 5 }
    ) {
      quantity
      distanceKm
      store {
        name
        address
      }
    }
  }
}

Real-World Example: Best Value Finder

Combine search, value sorting, and inventory lookup to find the best deals near you:

graphql
query BestValueCiderNearTrinityBellwoods {
  products(
    filters: {
      search: "cider"  # Search across name, producer, category
    }
    pagination: { first: 5 }
    sortBy: PRICE_PER_ALCOHOL_ML  # Sort by value
    sortDirection: ASC  # Lowest cost per ml of alcohol first
  ) {
    edges {
      node {
        sku
        name
        priceInCents           # Price in cents (e.g., 1295 = $12.95)
        producerName
        unitVolumeMl
        alcoholPercent
        pricePerAlcoholMl
        
        # Find nearby stores with this product in stock
        # Coordinates for Trinity Bellwoods Park (Toronto)
        inventories(
          filters: {
            latitude: 43.646195
            longitude: -79.41308
            radiusKm: 10      # Within 10km radius
            minQuantity: 1    # Must have at least 1 in stock
          }
          pagination: { first: 3 }
        ) {
          quantity
          distanceKm  # How far from park
          store {
            name
            address
            city
            hasParking
            hasBeerColdRoom
          }
        }
      }
      cursor
    }
    pageInfo {
      hasNextPage
      endCursor
    }
    totalCount
  }
}

This query finds the best value products (lowest cost per ml of alcohol) and shows which nearby stores have them in stock.

Key Concepts

No Authentication Required

Just send queries - no API keys, no OAuth, no setup.

GraphQL Queries

Request exactly the fields you need:

graphql
{
  product(sku: "438663") {
    name        # Request name
    priceInCents # Request price
    # Don't request fields you don't need
  }
}

Pagination

Use first to limit results:

graphql
products(pagination: { first: 20 })

Load more with after:

graphql
products(pagination: { first: 20, after: "cursor_value" })

Prices in Cents

All prices are integers in cents:

  • 1295 = $12.95
  • 2999 = $29.99

To display: priceInCents / 100

Rate Limits

  • 60 requests per minute per IP address
  • Check RateLimit-Remaining header
  • See Rate Limits for complete details

Next Steps

Now that you've made your first queries, choose your path:

📘 Learn by Building

🔧 Solve Specific Problems

📖 Reference Documentation

💡 Understand How It Works

Try the Interactive Explorer

Visit your favorite GraphQL client:

Need Help?

Happy building!