Code examples

Code examples

These examples demonstrate common integration patterns using modern JavaScript. Use them as a starting point for your implementation.


Example: fetch brands (async)

const baseUrl = 'https://api.hlc.bike/us/v3.0'
const apiKey = process.env.HLC_API_KEY

const res = await fetch(`${baseUrl}/Catalog/Brands`, {
  headers: {
    ApiKey: apiKey,
    'Accept-Encoding': 'gzip, deflate',
  },
})

const brands = await res.json()

Example: fetch products (paged)

const res = await fetch(
  `${baseUrl}/Catalog/Products?pageStartIndex=1&pageSize=100`,
  {
    headers: { ApiKey: apiKey },
  },
)

const products = await res.json()
Previous
Tools