API recipes

Practical examples for using the Houski API.

Examples

Validate your API key

Programming language

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

Validate your API key
Confirms the key exists and is enabled. It does not report usage and does not check your maximum monthly spend.
Request
Shell session
curl -X GET "http://127.0.0.1:8080/auth?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('http://127.0.0.1:8080/auth');
    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
}