ExamplesNode.js

Node.js Examples

Node.js examples for calling BrandQL with fetch and strict fallbacks.

Node.js

Use fetch in modern Node, or drop the URL into your HTTP client of choice.

BrandQL responds with a redirect. Use res.url to get the final image URL.

const res = await fetch('https://api.brandql.com/logo/stripe.com')

// BrandQL responds with a redirect to the actual image.
// res.url is the final image URL after redirects.
const imageUrl = res.url