Generate a client from OpenAPI
Hintadata publishes one OpenAPI contract for request fields, response models, authentication, errors, and examples. Generate a typed client with your preferred OpenAPI tool or call the HTTP API directly. Keep the generated code server-side because it uses the same secret Bearer key.
Plain JavaScript example
javascript
const response = await fetch(
'https://api.pricecompare.nordicdevhouse.com/v1/search?q=sony&limit=10',
{
headers: {
Authorization: `Bearer ${process.env.HINTADATA_API_KEY}`
}
}
);
if (!response.ok) throw new Error(`Hintadata request failed: ${response.status}`);
const result = await response.json();
console.log(result.items);Treat the contract as the source of truth
Regenerate clients when the contract version changes. Pin generated clients in your dependency lockfile and test the search, comparison, history, and watch flows your application actually uses.