Technical guides

Compression

The API supports gzip and deflate compression to reduce payload sizes and improve transfer speeds for large responses.


When to use it

Enable compression for large responses such as full product catalogs and inventory snapshots.

Use case: Mobile apps on unstable networks need smaller payloads and faster syncs.


Request compressed responses

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

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

const products = await res.json()

Note

Browsers ignore custom Accept-Encoding headers; Node and server runtimes honor them.

Previous
Caching