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 to keep it simple. In a real app, use a GraphQL client like urql or Apollo - they handle caching and errors for you. See our Build a Product Finder tutorial to learn how to set up urql in a React app.

Real-World Example

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

graphql
query BestValuNearTrinityBellwoods {
  products(
    filters: {
      search: "cooler"  # 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 }
        ) {
          edges {
            node {
              quantity
              distanceKm  # How far from park
              store {
                name
                address
                city
                hasColdBeerRoom
              }
            }
          }
          
        }
      }
      cursor
    }
    pageInfo {
      hasNextPage
      endCursor
    }
    totalCount
  }
}

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

Learn by building:

Solve specific problems:

Reference:

Understand how it works:

Try the Interactive Explorer

Visit your favorite GraphQL client:

Need Help?

Happy building!