Skip to content

Authentication

To use the Koral API, you’ll need to authenticate your requests. This guide explains how to obtain and use API keys for authentication.

Koral uses a search id to authenticate requests. You can view and manage your search id in the Koral Dashboard.

  1. Sign in to your Koral Dashboard
  2. Navigate to Settings > API Keys
  3. Create a new API key or use an existing one
  4. Copy your API key for use in your applications

Our endpoints require a search id to authenticate requests. You can pass the search id in the request header or as a body parameter.

GET /api/v1/search/image
Authorization: Bearer <search_id>

The search id is a unique identifier for one of your feeds and is used to track usage and billing. It is also tied to a list of domains that you also manage in the dashboard.

Here’s an example of how to authenticate a request to the Koral API using JavaScript:

// Using fetch with Bearer Token authentication
async function searchImages(query) {
const response = await fetch('https://api.koral.com/api/v1/search/image', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
'Authorization': `Bearer <search_id>`
},
body: JSON.stringify({
imageData: "<base64_encoded_image_data>",
limit: 10,
offset: 0,
})
});
return await response.json();
}
// Using fetch with Bearer Token authentication
async function searchImages(query) {
const response = await fetch('https://api.koral.com/api/v1/search/image', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
imageData: "<base64_encoded_image_data>",
limit: 10,
offset: 0,
searchId: "<customer feed id>"
})
});
return await response.json();
}

API requests are subject to rate limiting based on your subscription plan. The current limits are:

PlanRate Limit
Free100 requests/hour
Pro1,000 requests/hour
EnterpriseCustom

When you exceed your rate limit, the API will return a 429 Too Many Requests response.