
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@sharpapi/sharpapi-node-product-categories
Advanced tools
SharpAPI.com Node.js SDK for generating product categories

SharpAPI Product Categorization uses advanced AI to automatically assign accurate categories and subcategories to products based on their names and descriptions. Perfect for e-commerce, inventory management, and product organization.
npm install @sharpapi/sharpapi-node-product-categories
Visit SharpAPI.com to get your API key.
const { SharpApiProductCategoriesService } = require('@sharpapi/sharpapi-node-product-categories');
const apiKey = process.env.SHARP_API_KEY; // Store your API key in environment variables
const service = new SharpApiProductCategoriesService(apiKey);
const productName = 'Wireless Bluetooth Headphones with Noise Cancellation';
async function categorizeProduct() {
try {
// Submit categorization job
const statusUrl = await service.categorizeProduct(productName);
console.log('Job submitted. Status URL:', statusUrl);
// Fetch results (polls automatically until complete)
const result = await service.fetchResults(statusUrl);
const categories = result.getResultJson();
console.log('Suggested categories:', categories);
} catch (error) {
console.error('Error:', error.message);
}
}
categorizeProduct();
categorizeProduct(productName: string, maxCategories?: number): Promise<string>Assigns categories to a product based on its name and description.
Parameters:
productName (string, required): The product name or description to categorizemaxCategories (number, optional): Maximum number of categories to return (default: 5)Returns:
Example:
const statusUrl = await service.categorizeProduct(
'Organic Green Tea 100 Bags Premium Quality',
3
);
const result = await service.fetchResults(statusUrl);
The API returns categories with confidence scores:
{
"categories": [
{
"name": "Electronics > Audio > Headphones",
"weight": 10,
"subcategories": ["Wireless Headphones", "Noise-Canceling Headphones", "Bluetooth Audio"]
},
{
"name": "Electronics > Consumer Electronics",
"weight": 8,
"subcategories": ["Audio Devices", "Wireless Technology"]
}
]
}
const { SharpApiProductCategoriesService } = require('@sharpapi/sharpapi-node-product-categories');
const service = new SharpApiProductCategoriesService(process.env.SHARP_API_KEY);
const product = 'Professional DSLR Camera with 24MP Sensor';
service.categorizeProduct(product)
.then(statusUrl => service.fetchResults(statusUrl))
.then(result => {
const categories = result.getResultJson();
console.log('📂 Product Categories:');
categories.forEach((cat, index) => {
console.log(`${index + 1}. ${cat.name} (weight: ${cat.weight})`);
if (cat.subcategories) {
console.log(` Subcategories: ${cat.subcategories.join(', ')}`);
}
});
})
.catch(error => console.error('Categorization failed:', error));
const service = new SharpApiProductCategoriesService(process.env.SHARP_API_KEY);
const products = [
'Organic Cotton T-Shirt Men\'s Size L',
'Stainless Steel Water Bottle 750ml',
'Yoga Mat with Carrying Strap',
'Wireless Gaming Mouse RGB LED'
];
const categorized = await Promise.all(
products.map(async (product) => {
const statusUrl = await service.categorizeProduct(product, 3);
const result = await service.fetchResults(statusUrl);
const categories = result.getResultJson();
return {
product,
primary_category: categories[0]?.name,
all_categories: categories.map(c => c.name)
};
})
);
console.log('Categorized products:', categorized);
const service = new SharpApiProductCategoriesService(process.env.SHARP_API_KEY);
async function processNewProduct(productData) {
const productDescription = `${productData.name} ${productData.description}`;
const statusUrl = await service.categorizeProduct(productDescription);
const result = await service.fetchResults(statusUrl);
const categories = result.getResultJson();
// Get primary category (highest weight)
const primaryCategory = categories.sort((a, b) => b.weight - a.weight)[0];
return {
...productData,
category: primaryCategory.name,
subcategories: primaryCategory.subcategories,
all_categories: categories.map(c => c.name),
categorization_confidence: primaryCategory.weight
};
}
const newProduct = {
id: 12345,
name: 'Smart Fitness Tracker Watch',
description: 'Heart rate monitor, GPS, waterproof'
};
const enrichedProduct = await processNewProduct(newProduct);
console.log('Product with categories:', enrichedProduct);
The system recognizes hierarchical categories:
Top-Level Categories:
Subcategories:
POST /ecommerce/product_categories
For detailed API specifications, refer to:
This project is licensed under the MIT License. See the LICENSE.md file for details.
Powered by SharpAPI - AI-Powered API Workflow Automation
FAQs
SharpAPI.com Node.js SDK for generating product categories
We found that @sharpapi/sharpapi-node-product-categories demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.