!

API Recipes

Learn how to use the Houski API with practical examples.

Validate your API key

Programming language

Select the programming language you want to display the code examples in.

Validate API key and check usage
Check if your API key is valid and view your current usage statistics and limits.
Request
Shell session
curl -X GET "https://api.houski.ca/auth?action=validate&api_key=YOUR_API_KEY"
TypeScript code
const houski_recipe_data = async (): Promise<AuthResponse> => {

    // You must copy the AuthResponse type declarations from the 
    // Houski API documentation to strongly type the response

    const url = new URL('https://api.houski.ca/auth');
    url.searchParams.set('action', 'validate');
    url.searchParams.set('api_key', 'YOUR_API_KEY');

    const response = await fetch(url);
    const data = await response.json();

    return data;
}

(async () => {
let data: AuthResponse = await houski_recipe_data();

// Log the response
console.log(data);
})();
Response
JSON
{
  "api_key_authorized": true,
  "error": "",
  "time_ms": 0
}