# ProductCategorization.com Python Client
[](https://pypi.org/project/productcategorization/)
[](https://www.productcategorization.com/product_categorization_api.php)
---
## Overview
The `productcategorization` Python package provides seamless access to one of the world's most advanced product categorization APIs, powering e-commerce classification for unicorn startups, multinational enterprises, retail analytics platforms, adTech innovators, and online merchants. Whether you operate an e-commerce storefront, marketplace, or SaaS platform, this package allows you to integrate AI-powered categorization directly into your Python applications, unlocking world-class product, URL, and image classification using industry-standard taxonomies.
## Key Features
* **Ultra-Accurate Product Categorization**
Classify product titles, descriptions, and URLs using:
* **Google Shopping Taxonomy:** Over 5,500 hierarchical categories for granular and up-to-date mapping.
* **Shopify Taxonomy:** Leverage the latest Shopify category structure with \~11,000 fine-grained categories.
* **Amazon and Other Standard Taxonomies:** Flexibility for diverse retail needs.
* **Custom Taxonomies:** Tailor classifiers to your unique vertical or proprietary taxonomy.
* **Multi-Modal Classification**
* **Text**: Classify any product-related string.
* **URL**: Categorize products directly from their web pages.
* **Image**: Obtain Shopify categories and attribute extraction directly from images (using AI vision).
* **Buyer Persona Enrichment**
Every classification returns relevant buyer personas—select from a proprietary library of over 1,800 personas to enrich your analytics, personalization, or marketing automations.
Confidence scores and expanded context available.
* **High Scalability and Reliability**
Robust API supporting high throughput (rate limits adjustable upon request), with credit-based billing for predictable scaling.
* **Plug-and-Play Python Integration**
Simple, modern, and extensible Python API client.
See [Quickstart](#quickstart) for usage examples.
---
## Table of Contents
* [Getting Started](#getting-started)
* [Authentication](#authentication)
* [API Usage](#api-usage)
* [Text Categorization](#text-categorization)
* [URL Categorization](#url-categorization)
* [Image Categorization](#image-categorization)
* [Advanced Options](#advanced-options)
* [Buyer Personas and Confidence Scores](#buyer-personas-and-confidence-scores)
* [Context Expansion](#context-expansion)
* [Error Handling](#error-handling)
* [Best Practices](#best-practices)
* [Integration Examples](#integration-examples)
* [Contact & Support](#contact--support)
* [Related Services](#related-services)
* [References](#references)
---
## Getting Started
Install the package via PyPI:
```bash
pip install productcategorization
```
Or add it to your `requirements.txt` for automatic deployment.
---
## Authentication
All API access is secured by a personal API key.
To obtain your API key:
1. Sign up and purchase a subscription at [www.productcategorization.com](https://www.productcategorization.com/pricing.php
3. Provide the API key in every request (see examples).
> **Note:** Never share your API key publicly. Store it securely as an environment variable or in your configuration files.
---
## API Usage
### Text Categorization
Classify any product text (title, description, or keyword) in a single line:
```python
from productcategorization import ProductCategorizationAPI
api = ProductCategorizationAPI(api_key="your_api_key")
result = api.categorize_text("Fluorescent Highlighters 3pc Yellow")
print(result)
```
**Sample Response:**
```json
{
"total_credits": 100044,
"remaining_credits": 33075,
"language": "en",
"classification": "Office Supplies > Office Instruments > Writing & Drawing Instruments",
"buyer_personas": [
"Business Professional", "Office Professional", "Administrative Coordinator", ...
],
"buyer_personas_confidence_selection": {
"Office Professional": 0.9,
"Business Professional": 0.8,
...
},
"ID": "977",
"status": 200
}
```
**Parameters:**
* `query` (str): Product text for categorization.
* `confidence` (optional, int): Set to `1` to include confidence scores for each persona.
* `expand_context` (optional, int): Set to `1` to auto-generate expanded context for short/ambiguous texts.
---
### URL Categorization
You can also classify products by URL, leveraging our AI’s ability to extract relevant text and metadata:
```python
result = api.categorize_url("https://www.apple.com")
print(result)
```
**Sample Python (requests):**
```python
import requests
payload = {'query': 'www.apple.com', 'api_key': 'your_api_key', 'data_type': 'url'}
response = requests.post("https://www.productcategorization.com/api/iab/iab_web_content_filtering_url.php", data=payload)
print(response.json())
```
---
### Image Categorization
Classify products using image URLs or local image files (Shopify Taxonomy + attribute extraction):
```python
result = api.categorize_image(image_url="https://images.com/product.jpg", text="Product title")
print(result)
```
**Example Function:**
```python
import requests
import io
def call_api(image_url, text, api_key):
api_endpoint = 'https://www.productcategorization.com/api/ecommerce/ecommerce_shopify_image.php'
response = requests.get(image_url)
if response.status_code != 200:
return {'error': 'Failed to download image'}
image_file = io.BytesIO(response.content)
data = {'ip': '0', 'api_key': api_key, 'login': '0', 'text': text}
files = {'image': ('image.jpg', image_file, 'image/jpeg')}
response = requests.post(api_endpoint, data=data, files=files)
return response.json()
```
---
## Advanced Options
### Buyer Personas and Confidence Scores
Our AI delivers a unique set of buyer personas for every product—ideal for market analysis, targeted marketing, or persona-based analytics.
Enable confidence scoring to obtain relevance weights for each persona:
```python
result = api.categorize_text("Eco-Friendly Notebook", confidence=1)
print(result["buyer_personas_confidence_selection"])
```
### Context Expansion
For short or ambiguous inputs, enable `expand_context=1` to let our AI generate an enhanced description for improved classification accuracy:
```python
result = api.categorize_text("3pc Yellow Highlighters", expand_context=1)
print(result["expanded_context"])
```
---
## Error Handling
All API responses include a `status` code for programmatic error handling:
| Status | Meaning |
| ------ | ---------------------------------------- |
| 200 | Request was successful |
| 400 | Request malformed (check parameters) |
| 401 | Invalid API key (check or purchase key) |
| 403 | Quota exhausted (upgrade or add credits) |
Example error handling in Python:
```python
if result["status"] != 200:
print(f"API Error: {result.get('message', 'Unknown error')}")
```
---
## Best Practices
* **Monitor Remaining Credits:** Every response includes `total_credits` and `remaining_credits`. Plan your usage to avoid interruptions.
* **Respect Rate Limits:** Default is 60 requests per minute. Contact support for higher needs.
* **Secure Your API Key:** Do not embed directly in code if publishing open-source.
* **Use Context Expansion When Needed:** For short/ambiguous product titles, enable `expand_context`.
* **Batch Requests:** For large datasets, consider batching requests and handling quota gracefully.
---
## Integration Examples
### Python Example
```python
from productcategorization import ProductCategorizationAPI
api = ProductCategorizationAPI(api_key="your_api_key")
result = api.categorize_text("Fluorescent Highlighters 3pc Yellow")
print(result["classification"])
```
### JavaScript Example
```javascript
const apiBaseUrl = "https://www.productcategorization.com/api/ecommerce/ecommerce_category6_get.php?";
const apiKey = "your_api_key";
const queryText = "Fluorescent Highlighters 3pc Yellow";
const encodedQueryText = encodeURIComponent(queryText);
const finalUrl = `${apiBaseUrl}query=${encodedQueryText}&api_key=${apiKey}`;
fetch(finalUrl)
.then(response => response.json())
.then(data => console.log(data));
```
### Ruby Example
```ruby
require 'uri'
require 'net/http'
api_base_url = "https://www.productcategorization.com/api/ecommerce/ecommerce_category6_get.php"
api_key = "your_api_key"
query_text = "Fluorescent Highlighters 3pc Yellow"
encoded_query = URI.encode_www_form_component(query_text)
url = URI("#{api_base_url}?query=#{encoded_query}&api_key=#{api_key}")
response = Net::HTTP.get(url)
puts response
```
### C# Example
```csharp
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program {
static async Task Main(string[] args) {
var apiBaseUrl = "https://www.productcategorization.com/api/ecommerce/ecommerce_category6_get.php?";
var apiKey = "your_api_key";
var queryText = "Fluorescent Highlighters 3pc Yellow";
var encodedQueryText = Uri.EscapeDataString(queryText);
var finalUrl = $"{apiBaseUrl}query={encodedQueryText}&api_key={apiKey}";
using (HttpClient client = new HttpClient()) {
var response = await client.GetStringAsync(finalUrl);
Console.WriteLine(response);
}
}
}
```
---
## Contact & Support
Need a higher rate limit, a custom classifier, or additional support?
Visit [Contact](https://www.productcategorization.com/contact), or email support via your account dashboard.
---
## Related Services
Leverage our broader suite of AI-powered APIs to cover every aspect of your business’s data intelligence and privacy needs:
* **[Comment Moderation API](https://www.contentmoderationapi.net) – comment moderation api:**
Safeguard your community, app, or platform with industry-leading AI moderation for comments and user-generated content. Detect profanity, hate speech, spam, and toxicity in real time.
* **[Live Video Anonymization](https://www.anonymizationapi.com) – live video anonymization:**
Protect privacy with automatic anonymization of faces and sensitive objects in live video streams, supporting GDPR compliance and safeguarding user identities.
* **[Text Redaction API](https://www.redactionapi.net) – text redaction api:**
Redact personal data, financial information, or any sensitive fields from documents at scale using our high-precision redaction API.
* **[Company Enrichment Data](https://www.companydataapi.com) – company enrichment data:**
Instantly enhance your CRM, sales, or analytics platform with up-to-date company profiles, firmographics, and contact data.
* **[Domain Categorization Data](https://www.urlcategorizationdatabase.com) – domain categorization data:**
Access the world’s largest database of categorized domains for cybersecurity, web filtering, and content safety.
* **[AI Contract Analysis](https://www.aicontractreviewtool.com) – ai contract analysis:**
Revolutionize contract review workflows with advanced AI-driven contract analysis, risk detection, and compliance assessment.
Our APIs integrate seamlessly with your product workflows, providing reliable, scalable, and secure endpoints for your business logic.
---
## References & Further Reading
For best-in-class taxonomy, AI, and categorization research, explore:
* [Stanford AI Lab](https://ai.stanford.edu)
* [MIT CSAIL](https://www.csail.mit.edu)
* [Berkeley AI Research](https://bair.berkeley.edu)
* [Oxford Internet Institute](https://www.oii.ox.ac.uk)
* [UCL Centre for Artificial Intelligence](https://www.ucl.ac.uk/ai)
* [Google AI Blog](https://ai.googleblog.com/)
* [Microsoft Research](https://www.microsoft.com/en-us/research/)
* [arXiv Machine Learning](https://arxiv.org/list/cs.LG/recent)
For taxonomy standards and e-commerce data:
* [Google Shopping Taxonomy](https://support.google.com/merchants/answer/6324436)
* [Shopify Product Taxonomy](https://github.com/Shopify/product-taxonomy)
---
## License
This library is distributed under the MIT License.
---
## Disclaimer
This project is unaffiliated with Google, Shopify, or Amazon.
All trademarks are property of their respective owners.
---
# `__init__.py` Example
```python
import requests
class ProductCategorizationAPI:
def __init__(self, api_key):
self.api_key = api_key
self.base_url = "https://www.productcategorization.com/api/"
def categorize_text(self, text, confidence=0, expand_context=0):
params = {
"query": text,
"api_key": self.api_key,
"confidence": str(confidence),
"expand_context": str(expand_context)
}
response = requests.get(self.base_url + "ecommerce/ecommerce_category6_get.php", params=params)
return response.json()
def categorize_url(self, url):
payload = {
'query': url,
'api_key': self.api_key,
'data_type': 'url'
}
headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
response = requests.post(self.base_url + "iab/iab_web_content_filtering_url.php", data=payload, headers=headers)
return response.json()
def categorize_image(self, image_url, text="", ip="0", login="0"):
# Download image to memory
image_response = requests.get(image_url)
if image_response.status_code != 200:
return {'error': 'Failed to download image'}
import io
image_file = io.BytesIO(image_response.content)
data = {
'ip': ip,
'api_key': self.api_key,
'login': login,
'text': text
}
files = {
'image': ('image.jpg', image_file, 'image/jpeg')
}
response = requests.post(self.base_url + "ecommerce/ecommerce_shopify_image.php", data=data, files=files)
return response.json()
```
---
Raw data
{
"_id": null,
"home_page": "https://www.productcategorization.com",
"name": "productcategorizationapi",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "product categorization, classification, categorization",
"author": null,
"author_email": "info@productcategorizationapi.com",
"download_url": "https://files.pythonhosted.org/packages/fc/b4/c90b2054521611c9e3da4a4eb8c50f6ae04a5cd902fdc3a7fa3118cd2e8b/productcategorizationapi-1.3.tar.gz",
"platform": null,
"description": "\n# ProductCategorization.com Python Client\n\n[](https://pypi.org/project/productcategorization/)\n[](https://www.productcategorization.com/product_categorization_api.php)\n\n---\n\n## Overview\n\nThe `productcategorization` Python package provides seamless access to one of the world's most advanced product categorization APIs, powering e-commerce classification for unicorn startups, multinational enterprises, retail analytics platforms, adTech innovators, and online merchants. Whether you operate an e-commerce storefront, marketplace, or SaaS platform, this package allows you to integrate AI-powered categorization directly into your Python applications, unlocking world-class product, URL, and image classification using industry-standard taxonomies.\n\n## Key Features\n\n* **Ultra-Accurate Product Categorization**\n Classify product titles, descriptions, and URLs using:\n\n * **Google Shopping Taxonomy:** Over 5,500 hierarchical categories for granular and up-to-date mapping.\n * **Shopify Taxonomy:** Leverage the latest Shopify category structure with \\~11,000 fine-grained categories.\n * **Amazon and Other Standard Taxonomies:** Flexibility for diverse retail needs.\n * **Custom Taxonomies:** Tailor classifiers to your unique vertical or proprietary taxonomy.\n\n* **Multi-Modal Classification**\n\n * **Text**: Classify any product-related string.\n * **URL**: Categorize products directly from their web pages.\n * **Image**: Obtain Shopify categories and attribute extraction directly from images (using AI vision).\n\n* **Buyer Persona Enrichment**\n Every classification returns relevant buyer personas\u00e2\u20ac\u201dselect from a proprietary library of over 1,800 personas to enrich your analytics, personalization, or marketing automations.\n Confidence scores and expanded context available.\n\n* **High Scalability and Reliability**\n Robust API supporting high throughput (rate limits adjustable upon request), with credit-based billing for predictable scaling.\n\n* **Plug-and-Play Python Integration**\n Simple, modern, and extensible Python API client.\n See [Quickstart](#quickstart) for usage examples.\n\n---\n\n## Table of Contents\n\n* [Getting Started](#getting-started)\n* [Authentication](#authentication)\n* [API Usage](#api-usage)\n\n * [Text Categorization](#text-categorization)\n * [URL Categorization](#url-categorization)\n * [Image Categorization](#image-categorization)\n* [Advanced Options](#advanced-options)\n\n * [Buyer Personas and Confidence Scores](#buyer-personas-and-confidence-scores)\n * [Context Expansion](#context-expansion)\n* [Error Handling](#error-handling)\n* [Best Practices](#best-practices)\n* [Integration Examples](#integration-examples)\n* [Contact & Support](#contact--support)\n* [Related Services](#related-services)\n* [References](#references)\n\n---\n\n## Getting Started\n\nInstall the package via PyPI:\n\n```bash\npip install productcategorization\n```\n\nOr add it to your `requirements.txt` for automatic deployment.\n\n---\n\n## Authentication\n\nAll API access is secured by a personal API key.\nTo obtain your API key:\n\n1. Sign up and purchase a subscription at [www.productcategorization.com](https://www.productcategorization.com/pricing.php\n3. Provide the API key in every request (see examples).\n\n> **Note:** Never share your API key publicly. Store it securely as an environment variable or in your configuration files.\n\n---\n\n## API Usage\n\n### Text Categorization\n\nClassify any product text (title, description, or keyword) in a single line:\n\n```python\nfrom productcategorization import ProductCategorizationAPI\n\napi = ProductCategorizationAPI(api_key=\"your_api_key\")\nresult = api.categorize_text(\"Fluorescent Highlighters 3pc Yellow\")\nprint(result)\n```\n\n**Sample Response:**\n\n```json\n{\n \"total_credits\": 100044,\n \"remaining_credits\": 33075,\n \"language\": \"en\",\n \"classification\": \"Office Supplies > Office Instruments > Writing & Drawing Instruments\",\n \"buyer_personas\": [\n \"Business Professional\", \"Office Professional\", \"Administrative Coordinator\", ...\n ],\n \"buyer_personas_confidence_selection\": {\n \"Office Professional\": 0.9,\n \"Business Professional\": 0.8,\n ...\n },\n \"ID\": \"977\",\n \"status\": 200\n}\n```\n\n**Parameters:**\n\n* `query` (str): Product text for categorization.\n* `confidence` (optional, int): Set to `1` to include confidence scores for each persona.\n* `expand_context` (optional, int): Set to `1` to auto-generate expanded context for short/ambiguous texts.\n\n---\n\n### URL Categorization\n\nYou can also classify products by URL, leveraging our AI\u00e2\u20ac\u2122s ability to extract relevant text and metadata:\n\n```python\nresult = api.categorize_url(\"https://www.apple.com\")\nprint(result)\n```\n\n**Sample Python (requests):**\n\n```python\nimport requests\n\npayload = {'query': 'www.apple.com', 'api_key': 'your_api_key', 'data_type': 'url'}\nresponse = requests.post(\"https://www.productcategorization.com/api/iab/iab_web_content_filtering_url.php\", data=payload)\nprint(response.json())\n```\n\n---\n\n### Image Categorization\n\nClassify products using image URLs or local image files (Shopify Taxonomy + attribute extraction):\n\n```python\nresult = api.categorize_image(image_url=\"https://images.com/product.jpg\", text=\"Product title\")\nprint(result)\n```\n\n**Example Function:**\n\n```python\nimport requests\nimport io\n\ndef call_api(image_url, text, api_key):\n api_endpoint = 'https://www.productcategorization.com/api/ecommerce/ecommerce_shopify_image.php'\n response = requests.get(image_url)\n if response.status_code != 200:\n return {'error': 'Failed to download image'}\n image_file = io.BytesIO(response.content)\n data = {'ip': '0', 'api_key': api_key, 'login': '0', 'text': text}\n files = {'image': ('image.jpg', image_file, 'image/jpeg')}\n response = requests.post(api_endpoint, data=data, files=files)\n return response.json()\n```\n\n---\n\n## Advanced Options\n\n### Buyer Personas and Confidence Scores\n\nOur AI delivers a unique set of buyer personas for every product\u00e2\u20ac\u201dideal for market analysis, targeted marketing, or persona-based analytics.\nEnable confidence scoring to obtain relevance weights for each persona:\n\n```python\nresult = api.categorize_text(\"Eco-Friendly Notebook\", confidence=1)\nprint(result[\"buyer_personas_confidence_selection\"])\n```\n\n### Context Expansion\n\nFor short or ambiguous inputs, enable `expand_context=1` to let our AI generate an enhanced description for improved classification accuracy:\n\n```python\nresult = api.categorize_text(\"3pc Yellow Highlighters\", expand_context=1)\nprint(result[\"expanded_context\"])\n```\n\n---\n\n## Error Handling\n\nAll API responses include a `status` code for programmatic error handling:\n\n| Status | Meaning |\n| ------ | ---------------------------------------- |\n| 200 | Request was successful |\n| 400 | Request malformed (check parameters) |\n| 401 | Invalid API key (check or purchase key) |\n| 403 | Quota exhausted (upgrade or add credits) |\n\nExample error handling in Python:\n\n```python\nif result[\"status\"] != 200:\n print(f\"API Error: {result.get('message', 'Unknown error')}\")\n```\n\n---\n\n## Best Practices\n\n* **Monitor Remaining Credits:** Every response includes `total_credits` and `remaining_credits`. Plan your usage to avoid interruptions.\n* **Respect Rate Limits:** Default is 60 requests per minute. Contact support for higher needs.\n* **Secure Your API Key:** Do not embed directly in code if publishing open-source.\n* **Use Context Expansion When Needed:** For short/ambiguous product titles, enable `expand_context`.\n* **Batch Requests:** For large datasets, consider batching requests and handling quota gracefully.\n\n---\n\n## Integration Examples\n\n### Python Example\n\n```python\nfrom productcategorization import ProductCategorizationAPI\n\napi = ProductCategorizationAPI(api_key=\"your_api_key\")\nresult = api.categorize_text(\"Fluorescent Highlighters 3pc Yellow\")\nprint(result[\"classification\"])\n```\n\n### JavaScript Example\n\n```javascript\nconst apiBaseUrl = \"https://www.productcategorization.com/api/ecommerce/ecommerce_category6_get.php?\";\nconst apiKey = \"your_api_key\";\nconst queryText = \"Fluorescent Highlighters 3pc Yellow\";\nconst encodedQueryText = encodeURIComponent(queryText);\nconst finalUrl = `${apiBaseUrl}query=${encodedQueryText}&api_key=${apiKey}`;\n\nfetch(finalUrl)\n .then(response => response.json())\n .then(data => console.log(data));\n```\n\n### Ruby Example\n\n```ruby\nrequire 'uri'\nrequire 'net/http'\n\napi_base_url = \"https://www.productcategorization.com/api/ecommerce/ecommerce_category6_get.php\"\napi_key = \"your_api_key\"\nquery_text = \"Fluorescent Highlighters 3pc Yellow\"\n\nencoded_query = URI.encode_www_form_component(query_text)\nurl = URI(\"#{api_base_url}?query=#{encoded_query}&api_key=#{api_key}\")\n\nresponse = Net::HTTP.get(url)\nputs response\n```\n\n### C# Example\n\n```csharp\nusing System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\n\nclass Program {\n static async Task Main(string[] args) {\n var apiBaseUrl = \"https://www.productcategorization.com/api/ecommerce/ecommerce_category6_get.php?\";\n var apiKey = \"your_api_key\";\n var queryText = \"Fluorescent Highlighters 3pc Yellow\";\n var encodedQueryText = Uri.EscapeDataString(queryText);\n var finalUrl = $\"{apiBaseUrl}query={encodedQueryText}&api_key={apiKey}\";\n\n using (HttpClient client = new HttpClient()) {\n var response = await client.GetStringAsync(finalUrl);\n Console.WriteLine(response);\n }\n }\n}\n```\n\n---\n\n## Contact & Support\n\nNeed a higher rate limit, a custom classifier, or additional support?\nVisit [Contact](https://www.productcategorization.com/contact), or email support via your account dashboard.\n\n---\n\n## Related Services\n\nLeverage our broader suite of AI-powered APIs to cover every aspect of your business\u00e2\u20ac\u2122s data intelligence and privacy needs:\n\n* **[Comment Moderation API](https://www.contentmoderationapi.net) \u00e2\u20ac\u201c comment moderation api:**\n Safeguard your community, app, or platform with industry-leading AI moderation for comments and user-generated content. Detect profanity, hate speech, spam, and toxicity in real time.\n\n* **[Live Video Anonymization](https://www.anonymizationapi.com) \u00e2\u20ac\u201c live video anonymization:**\n Protect privacy with automatic anonymization of faces and sensitive objects in live video streams, supporting GDPR compliance and safeguarding user identities.\n\n* **[Text Redaction API](https://www.redactionapi.net) \u00e2\u20ac\u201c text redaction api:**\n Redact personal data, financial information, or any sensitive fields from documents at scale using our high-precision redaction API.\n\n* **[Company Enrichment Data](https://www.companydataapi.com) \u00e2\u20ac\u201c company enrichment data:**\n Instantly enhance your CRM, sales, or analytics platform with up-to-date company profiles, firmographics, and contact data.\n\n* **[Domain Categorization Data](https://www.urlcategorizationdatabase.com) \u00e2\u20ac\u201c domain categorization data:**\n Access the world\u00e2\u20ac\u2122s largest database of categorized domains for cybersecurity, web filtering, and content safety.\n\n* **[AI Contract Analysis](https://www.aicontractreviewtool.com) \u00e2\u20ac\u201c ai contract analysis:**\n Revolutionize contract review workflows with advanced AI-driven contract analysis, risk detection, and compliance assessment.\n\nOur APIs integrate seamlessly with your product workflows, providing reliable, scalable, and secure endpoints for your business logic.\n\n---\n\n## References & Further Reading\n\nFor best-in-class taxonomy, AI, and categorization research, explore:\n\n* [Stanford AI Lab](https://ai.stanford.edu)\n* [MIT CSAIL](https://www.csail.mit.edu)\n* [Berkeley AI Research](https://bair.berkeley.edu)\n* [Oxford Internet Institute](https://www.oii.ox.ac.uk)\n* [UCL Centre for Artificial Intelligence](https://www.ucl.ac.uk/ai)\n* [Google AI Blog](https://ai.googleblog.com/)\n* [Microsoft Research](https://www.microsoft.com/en-us/research/)\n* [arXiv Machine Learning](https://arxiv.org/list/cs.LG/recent)\n\nFor taxonomy standards and e-commerce data:\n\n* [Google Shopping Taxonomy](https://support.google.com/merchants/answer/6324436)\n* [Shopify Product Taxonomy](https://github.com/Shopify/product-taxonomy)\n\n---\n\n## License\n\nThis library is distributed under the MIT License.\n\n---\n\n## Disclaimer\n\nThis project is unaffiliated with Google, Shopify, or Amazon.\nAll trademarks are property of their respective owners.\n\n---\n\n# `__init__.py` Example\n\n```python\nimport requests\n\nclass ProductCategorizationAPI:\n def __init__(self, api_key):\n self.api_key = api_key\n self.base_url = \"https://www.productcategorization.com/api/\"\n\n def categorize_text(self, text, confidence=0, expand_context=0):\n params = {\n \"query\": text,\n \"api_key\": self.api_key,\n \"confidence\": str(confidence),\n \"expand_context\": str(expand_context)\n }\n response = requests.get(self.base_url + \"ecommerce/ecommerce_category6_get.php\", params=params)\n return response.json()\n\n def categorize_url(self, url):\n payload = {\n 'query': url,\n 'api_key': self.api_key,\n 'data_type': 'url'\n }\n headers = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n }\n response = requests.post(self.base_url + \"iab/iab_web_content_filtering_url.php\", data=payload, headers=headers)\n return response.json()\n\n def categorize_image(self, image_url, text=\"\", ip=\"0\", login=\"0\"):\n # Download image to memory\n image_response = requests.get(image_url)\n if image_response.status_code != 200:\n return {'error': 'Failed to download image'}\n import io\n image_file = io.BytesIO(image_response.content)\n data = {\n 'ip': ip,\n 'api_key': self.api_key,\n 'login': login,\n 'text': text\n }\n files = {\n 'image': ('image.jpg', image_file, 'image/jpeg')\n }\n response = requests.post(self.base_url + \"ecommerce/ecommerce_shopify_image.php\", data=data, files=files)\n return response.json()\n```\n\n---\n\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "product categorization API",
"version": "1.3",
"project_urls": {
"Homepage": "https://www.productcategorization.com"
},
"split_keywords": [
"product categorization",
" classification",
" categorization"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8efa3bf0522b1bc4a968fc2ea3c35ee8e487313de30e5fc606bcf2e28fb77bb5",
"md5": "13cf87679d74cafcf18b5d98b82175a6",
"sha256": "e47206a023554dd186fb9bae36d6495a2d12762aaa56ebd972acd43a331fcd32"
},
"downloads": -1,
"filename": "productcategorizationapi-1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "13cf87679d74cafcf18b5d98b82175a6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10063,
"upload_time": "2025-08-04T11:29:02",
"upload_time_iso_8601": "2025-08-04T11:29:02.918076Z",
"url": "https://files.pythonhosted.org/packages/8e/fa/3bf0522b1bc4a968fc2ea3c35ee8e487313de30e5fc606bcf2e28fb77bb5/productcategorizationapi-1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fcb4c90b2054521611c9e3da4a4eb8c50f6ae04a5cd902fdc3a7fa3118cd2e8b",
"md5": "077e20d0a7b8db08c9e36ae746355fee",
"sha256": "53a26e1b66df82cef1f0e96b7cdc7f92781e514e4e2237a45f72e2bb972a9af3"
},
"downloads": -1,
"filename": "productcategorizationapi-1.3.tar.gz",
"has_sig": false,
"md5_digest": "077e20d0a7b8db08c9e36ae746355fee",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9975,
"upload_time": "2025-08-04T11:29:04",
"upload_time_iso_8601": "2025-08-04T11:29:04.079617Z",
"url": "https://files.pythonhosted.org/packages/fc/b4/c90b2054521611c9e3da4a4eb8c50f6ae04a5cd902fdc3a7fa3118cd2e8b/productcategorizationapi-1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-04 11:29:04",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "productcategorizationapi"
}