Back to Home
Custom Categories
Learn how to use custom categories with the RUE API to tailor content categorization to your specific needs.
Overview
While the RUE API provides a comprehensive set of default categories, you can also define custom categories to better suit your specific use case. This feature allows you to categorize content according to your own taxonomy or industry-specific terminology.
Using Custom Categories
To use custom categories, you need to include them in your API request when calling the categorize_content endpoint. Here's an example:
const axios = require('axios');
async function categorizeWithCustomCategories(url, customCategories) {
try {
const response = await axios.post('https://api.rue.ai/v1/categorize_content',
{
url: url,
custom_categories: customCategories
},
{
headers: {
'Content-Type': 'application/json',
'X-API-Key': 'YOUR_API_KEY'
}
}
);
console.log('Categorization results:', response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
}
// Example usage
const url = 'https://example.com/article';
const customCategories = ['Artificial Intelligence', 'Blockchain', 'Internet of Things', 'Quantum Computing'];
categorizeWithCustomCategories(url, customCategories);
Best Practices for Custom Categories
- Keep category names concise and descriptive
- Use consistent terminology across your categories
- Avoid overlapping or redundant categories
- Consider hierarchical relationships between categories
- Regularly review and update your custom categories
Limitations and Considerations
- You can provide up to 50 custom categories per request
- Each category name should not exceed 100 characters
- Custom categories are evaluated in addition to, not instead of, our default categories
- The accuracy of custom categorization may vary depending on the specificity and clarity of your category names
For more information on how to effectively use custom categories, check out our Examples page. If you need assistance in defining custom categories for your specific use case, don't hesitate to contact our support team.