UNPKG

productcategorization

Version:

Updated: October 12, 2024

307 lines (223 loc) 18.4 kB
# Product Categorization API for Node.js Updated: October 12, 2024 This is a Node.js module that uses text classification ML model to classify texts into Ecommerce based categories, using a [product categorization API](https://www.productcategorization.com) service. It supports a wide array of different taxonomies of definitions of categories. First is the Google Shopping taxonomy with around 5600 categories, you can find them here: [https://www.google.com/basepages/producttype/taxonomy.en-US.txt](https://www.google.com/basepages/producttype/taxonomy.en-US.txt) Categories are in form of Tiers or levels of depth. E.g. Tier 1 categories include: - Toys & Games - Vehicles & Parts - Arts & Entertainment - Apparel & Accessories - Baby & Toddler - Media - Hardware - Home & Garden - Electronics - Office Supplies - Furniture - Sporting Goods - Health & Beauty - Food, Beverages & Tobacco - Animals & Pet Supplies - Business & Industrial - Mature - Cameras & Optics - Religious & Ceremonial - Software - Luggage & Bags There are other, higher Tiers which cover increasingly more detail. In addition to Google Shopping, our service provides custom support for 100+ other marketplaces, including eBay. If you have your own definition of categories that are different from the standard ones, we can set up a product categorization AI model for these as well. In addition to categories, we also return 10 buyer personas that are most relevant for given product. For example, for product pgytech mavic mini mini uv filter professional we return category "Cameras & Optics > Camera & Optic Accessories > Camera Lens Accessories > Lens Filters" and these buyer personas: - Travel Enthusiast - Sports Event Participant - Street Style Aficionado - Professional Photographer - Outdoor Adventure Enthusiast - Documentary Filmmaker - Astronomy Enthusiast - Underwater Capture Specialist - Wildlife Enthusiast - Wedding Planner # Installation ``` npm i productcategorization ``` # Usage example ``` const apiBaseUrl = "https://www.productcategorization.com/api/ecommerce/ecommerce_category6_get.php?"; const api_Key = "your api key"; const query = "macbook air"; const encodedQueryText = encodeURIComponent(query); const finalUrl = `${apiBaseUrl}query=${encodedQueryText}&api_key=${api_Key}`; fetch(finalUrl) .then(response => response.text()) .then(data => { console.log(data); }) .catch((error) => console.error('Error:', error)); ``` Above request will return this: ``` {"language": "en", "total_credits": 12, "remaining_credits": 12, "classification": "Electronics > Computers > Laptops", "buyer_personas": ["Home Office Enthusiast", "Budget Conscious Individual", "Academic Researcher", "High-End Gamer", "Small Business Professional", "Professional Designer", "Tech Savvy Individual", "Software Developer", "Casual Lifestyle Enthusiast", "Digital Nomad"], "category": "Electronics > Computers > Laptops", "status": 200} ``` ## Our other services Network administrators managing employee internet access or securing corporate environments often need domain-level content controls that work offline and at wire speed. Our [web filtering for remote employees](https://www.webfilteringdatabase.com) provides a downloadable dataset of 100 million domains organized into 59 categories, ready for deployment in firewalls, secure web gateways, and proxy servers. Categories span productivity risks like social media and streaming as well as security threats such as malware, phishing, and command-and-control domains. The database integrates with standard policy engines so teams can enforce acceptable-use rules without routing traffic through a third-party service. For teams that need a broader [URL categorization database](https://www.urlcategorizationdatabase.com) covering IAB content taxonomy, ad-tech verticals, and ecommerce classifications, our companion dataset delivers categorized domains at enterprise scale. It is well suited for contextual targeting, brand safety, and large-scale analytics where coverage across millions of domains is required. We also provide an [Anonymization API](https://www.anonymizationapi.com) for privacy-preserving media and data workflows. E-commerce platforms that also serve educational institutions can benefit from CIPA-compliant web filtering. The Children's Internet Protection Act requires schools and libraries receiving E-Rate funding to block harmful content — the [FCC's CIPA compliance guide](https://www.fcc.gov/consumers/guides/childrens-internet-protection-act) details these federal mandates, and the [American Library Association's CIPA resource page](https://www.ala.org/advocacy/advleg/federallegislation/cipa) provides practical implementation guidance for institutions navigating the law. Our [cipa compliant content filters](https://www.cipawebfiltering.com) classifies 120 million domains into 57+ categories designed for schools and libraries — covering obscene material, child exploitation content, and content harmful to minors as defined in the statute — ensuring product and vendor sites remain accessible while policy-restricted content stays blocked. The database integrates directly with DNS resolvers, proxy servers, and firewall appliances used in school and library networks. Fraud prevention is another area where domain intelligence adds value. The [Anti-Phishing Working Group (APWG)](https://apwg.org/trendsreports/) reports that phishing attacks continue reaching record volumes, and [CISA's phishing guidance](https://www.cisa.gov/secure-our-world/recognize-and-report-phishing) recommends domain-level blocking as a frontline defense. Our [phishing domain lookup API](https://www.phishingdetectionapi.com) checks domains against 390,000+ DNS-verified active phishing sites so marketplace operators can flag or remove listings that link to credential-harvesting pages. Every domain in the dataset is DNS-verified to confirm it is actively serving malicious content, reducing false positives that could disrupt legitimate transactions. These complementary services extend product categorization into the broader trust-and-safety stack that modern platforms require. # Usage of product categorization AI Product categorization AI is primarily used in online stores, to provide more detailed categorization of stores products, which leads to better searchability, filtering and improved conversions of the online store. Product categorization API can also be used in other settings, e.g. as part of internal or external apps/Saas websites. The process of categorizing products is usually automated, using a machine learning model, due to sheer number of products that are available on online stores. E.g. Amazon sells more than 12 million products and if including Amazon Marketplace sellers, the number of products sold is over 300 million. You can learn more about other use cases in this detailed article on [product categorization AI](https://medium.com/product-categorization/product-categorization-introduction-d62bb92e8515). # What are the benefits of product categorization Product categorization API provide many benefits: 1. Improved Search Experience One of the primary applications of product categorization is to enhance the search experience for customers. With well-organized categories, shoppers can easily navigate through your product range, finding what they need quickly and effortlessly. This streamlined process reduces the time spent searching and increases the likelihood of a successful purchase. Without product categorization, customers may get frustrated, leading to lower conversion rates and reduced customer satisfaction. Additionally, a well-structured categorization system can help customers discover related products they might not have initially considered, potentially increasing sales and customer engagement. 2. Personalized Recommendations Product categorization enables advanced algorithms to generate personalized product recommendations. By understanding which categories a customer frequently shops in, you can provide tailored suggestions that are more likely to result in a purchase. This tactic can significantly boost your average order value and increase customer loyalty. Moreover, personalized recommendations based on product categories can help cross-sell and upsell related items, further enhancing the shopping experience and increasing revenue. By analyzing customer behavior within specific categories, businesses can also identify trends and preferences, allowing for more accurate and effective recommendation strategies. 3. Enhanced SEO Performance Product categorization also helps improve SEO performance. By using appropriate keywords in your product categories, you can improve your visibility on search engines, driving more organic traffic to your online store. Well-structured categories can also contribute to better site architecture, making it easier for search engine crawlers to index your pages. This improved indexing can lead to higher rankings for category-specific searches, potentially attracting more targeted traffic to your site. Furthermore, category pages can serve as valuable landing pages for long-tail keywords, capturing more specific search queries and improving overall search visibility. 4. Simplified Inventory Management For businesses, product categorization can simplify inventory management. By grouping similar products together, retailers can gain a clearer view of their stock levels and better manage supply and demand. This organization allows for more efficient restocking processes and helps identify slow-moving items within specific categories. Additionally, categorization can facilitate better forecasting of inventory needs based on category-specific trends and seasonality. This improved inventory management can lead to reduced carrying costs, minimized stockouts, and optimized cash flow. 5. Easier Comparative Shopping Categorizing products allows customers to engage in comparative shopping easily. When similar products are grouped together, customers can compare features, prices, and reviews side-by-side, helping them make informed purchase decisions. This transparency can increase customer trust and satisfaction, as they feel empowered to choose the best product for their needs. Moreover, by facilitating easy comparisons, businesses can highlight the unique selling points of their products within each category, potentially increasing conversions for higher-value or premium items. Buyer personas can provide the following benefits: 1. Advanced Customer Profiling Every purchase on your site provides valuable data points. By linking products to specific buyer personas, you can create dynamic customer profiles based on their interactions. For instance, a customer might be categorized as 54% 'Eco-Conscious Shopper', 24% 'Tech-Savvy Professional', 22% 'Budget-Conscious Student', and 8% 'Digital Photographer'. This detailed insight is invaluable for marketers and enables highly targeted future interactions. 2. Tailored Product Descriptions Understanding a user's buyer persona profile allows for customized product descriptions. For example, an "Eco-Conscious Shopper" might see a description highlighting a product's sustainability features: "Made from recycled materials, 100% recyclable, and produced in a factory using only renewable energy sources." This personalization increases product resonance and potentially boosts conversions and sales. Our free demo showcases this capability. Simply input any product description, and our AI service will identify relevant buyer personas and generate tailored descriptions for each. 3. Enhanced Product Recommendations A clear understanding of a customer's persona alignment enables more accurate and appealing product recommendations, increasing the likelihood of additional purchases. 4. Efficient Inventory Management Knowing your customers' most common buyer personas helps anticipate product demand, informing stock purchasing decisions and reducing the risk of over or understocking. 5. Optimized Pricing Strategies Insights into the budget constraints and spending habits of your buyer personas allow for tailored pricing and discount strategies, maximizing revenue and profitability. 6. Improved User Experience Buyer personas can inform website design, resulting in a more intuitive shopping experience. This might include personalized landing pages or navigation paths for different personas. 7. Informed Product Development Understanding your buyer personas' needs and preferences helps identify gaps in your product range and develop new products aligned with customer desires. 8. Data-Driven Decision Making Implementing buyer personas for individual products provides rich, actionable data, enabling strategic decisions based on actual customer behavior rather than assumptions. 9. Increased Customer Loyalty Personalization driven by buyer personas demonstrates that you understand and value customers' unique needs, potentially increasing satisfaction and loyalty. 10. Competitive Edge In a crowded online marketplace, offering a personalized shopping experience sets your store apart. Effective use of buyer personas can provide a level of service that competitors may struggle to match. 543 # Usage in online dashboard The API service also has an online dashboard version, which may be sometimes more conveninent and quicker than usage of API. Here is an example screenshot: ![image](https://user-images.githubusercontent.com/58834207/172150185-e06d7739-99f2-4d98-b0ea-2d9367aded2c.png) # Form of json Example output from Product Categorization API for "online puzzle": ``` { "classification": [ { "category": "Toys & Games", "value": 0.9638764770961815 }, { "category": "Baby & Toddler", "value": 0.035059565554713144 }, { "category": "Home & Garden", "value": 0.0002963369659567312 }, { "category": "Sporting Goods", "value": 0.00023261258646299374 }, { "category": "Apparel & Accessories", "value": 0.0002154233610409791 }, { "category": "Arts & Entertainment", "value": 0.00006532454044944747 }, { "category": "Animals & Pet Supplies", "value": 0.000059422859421801474 }, { "category": "Food, Beverages & Tobacco", "value": 0.00002773526129753021 }, { "category": "Hardware", "value": 0.00002505846630513308 }, { "category": "Vehicles & Parts", "value": 0.000021958370880675152 }, { "category": "Office Supplies", "value": 0.00001764502356391286 }, { "category": "Software", "value": 0.000016447423481062168 }, { "category": "Electronics", "value": 0.000016334880730325363 }, { "category": "Luggage & Bags", "value": 0.00001318376032711391 }, { "category": "Business & Industrial", "value": 0.000012255740845011877 }, { "category": "Health & Beauty", "value": 0.000011468345231805086 }, { "category": "Mature", "value": 0.000009977075952148216 }, { "category": "Furniture", "value": 0.000008364040734807803 }, { "category": "Religious & Ceremonial", "value": 0.0000053440428514067635 }, { "category": "Media", "value": 0.0000046483939975945625 }, { "category": "Cameras & Optics", "value": 0.00000441620957481985 } ], "language": "en" } ``` # Language support API service accepts texts not only in English, but many other languages, including German, Italian, Spanish, Dutch, French and others. # Useful resources - IAB taxonomy: [https://www.iab.com/guidelines/content-taxonomy/) - Facebook Taxonomy: [https://www.facebook.com/business/help/526764014610932](https://www.facebook.com/business/help/526764014610932) - [Categorization of websites - with examples](https://www.alpha-quantum.com/blog/website-categorization/website-categorization-api/) Beyond e-commerce taxonomies, domain-level classification increasingly covers AI services. As the [NIST AI Risk Management Framework](https://www.nist.gov/artificial-intelligence) outlines, organizations need structured governance over which AI tools employees interact with, and the [OECD AI Policy Observatory](https://oecd.ai/en/) tracks how governments worldwide are drafting regulations that mandate controls over AI usage in workplaces and schools. Enterprises now need to [AI application blocklist](https://www.aitoolsblocklist.com) to enforce data-security policies, since employees routinely paste confidential content into AI chatbots and writing assistants. Our AI tools blocklist provides a continuously updated dataset of classified AI-tool domains — organized into functional categories such as conversational AI, code generation, image synthesis, voice cloning, and AI companions — making it enforceable in firewalls, DNS filters, proxies, and NGFW rules. The same functional taxonomy separates AI code assistants from AI image generators, enabling per-category acceptable-use rules rather than blanket bans. # Our package is available on these websites - [https://www.npmjs.com/package/productcategorization](https://www.npmjs.com/package/productcategorization) - [https://www.jsdelivr.com/package/npm/productcategorization](https://www.jsdelivr.com/package/npm/productcategorization) - [https://npmmirror.com/package/productcategorization](https://npmmirror.com/package/productcategorization) - [https://www.npmtrends.com/productcategorization](https://www.npmtrends.com/productcategorization) - [https://openbase.com/js/productcategorization/documentation](https://openbase.com/js/productcategorization/documentation) - [https://socket.dev/npm/package/productcategorization/overview](https://socket.dev/npm/package/productcategorization/overview) - [https://pypi.org/project/websiteclassificationapi/](https://pypi.org/project/websiteclassificationapi/) - [https://www.npmjs.com/package/cipawebfiltering](https://www.npmjs.com/package/cipawebfiltering) — CIPA web filtering database for school districts - [https://www.aitoolsblocklist.com](https://www.aitoolsblocklist.com) — AI application blocklist for enterprise and education