productcategorizationapi 1.6__tar.gz → 1.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- productcategorizationapi-1.8/LICENSE +21 -0
- productcategorizationapi-1.8/PKG-INFO +438 -0
- {productcategorizationapi-1.6 → productcategorizationapi-1.8}/README.md +2 -6
- productcategorizationapi-1.8/productcategorizationapi.egg-info/PKG-INFO +438 -0
- {productcategorizationapi-1.6 → productcategorizationapi-1.8}/productcategorizationapi.egg-info/SOURCES.txt +1 -0
- {productcategorizationapi-1.6 → productcategorizationapi-1.8}/setup.py +44 -39
- productcategorizationapi-1.6/PKG-INFO +0 -441
- productcategorizationapi-1.6/productcategorizationapi.egg-info/PKG-INFO +0 -441
- {productcategorizationapi-1.6 → productcategorizationapi-1.8}/productcategorizationapi/__init__.py +0 -0
- {productcategorizationapi-1.6 → productcategorizationapi-1.8}/productcategorizationapi.egg-info/dependency_links.txt +0 -0
- {productcategorizationapi-1.6 → productcategorizationapi-1.8}/productcategorizationapi.egg-info/top_level.txt +0 -0
- {productcategorizationapi-1.6 → productcategorizationapi-1.8}/setup.cfg +0 -0
- {productcategorizationapi-1.6 → productcategorizationapi-1.8}/test/__init__.py +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021 arnu515
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: productcategorizationapi
|
|
3
|
+
Version: 1.8
|
|
4
|
+
Summary: product categorization API
|
|
5
|
+
Home-page: https://www.productcategorization.com
|
|
6
|
+
Author-email: info@productcategorizationapi.com
|
|
7
|
+
Project-URL: Homepage, https://www.productcategorization.com
|
|
8
|
+
Project-URL: AI Tools Blocklist, https://www.aitoolsblocklist.com
|
|
9
|
+
Keywords: product categorization,classification,categorization
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Environment :: GPU :: NVIDIA CUDA :: 11.3
|
|
12
|
+
Classifier: Environment :: GPU :: NVIDIA CUDA :: 11.0
|
|
13
|
+
Classifier: Environment :: GPU :: NVIDIA CUDA
|
|
14
|
+
Classifier: Environment :: GPU :: NVIDIA CUDA :: 11.2
|
|
15
|
+
Classifier: Environment :: GPU :: NVIDIA CUDA :: 10.1
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
# ProductCategorization.com Python Client
|
|
22
|
+
|
|
23
|
+
[](https://pypi.org/project/productcategorization/)
|
|
24
|
+
[](https://www.productcategorization.com/product_categorization_api.php)
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Overview
|
|
29
|
+
|
|
30
|
+
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.
|
|
31
|
+
|
|
32
|
+
## Key Features
|
|
33
|
+
|
|
34
|
+
* **Ultra-Accurate Product Categorization**
|
|
35
|
+
Classify product titles, descriptions, and URLs using:
|
|
36
|
+
|
|
37
|
+
* **Google Shopping Taxonomy:** Over 5,500 hierarchical categories for granular and up-to-date mapping.
|
|
38
|
+
* **Shopify Taxonomy:** Leverage the latest Shopify category structure with \~11,000 fine-grained categories.
|
|
39
|
+
* **Amazon and Other Standard Taxonomies:** Flexibility for diverse retail needs.
|
|
40
|
+
* **Custom Taxonomies:** Tailor classifiers to your unique vertical or proprietary taxonomy.
|
|
41
|
+
|
|
42
|
+
* **Multi-Modal Classification**
|
|
43
|
+
|
|
44
|
+
* **Text**: Classify any product-related string.
|
|
45
|
+
* **URL**: Categorize products directly from their web pages.
|
|
46
|
+
* **Image**: Obtain Shopify categories and attribute extraction directly from images (using AI vision).
|
|
47
|
+
|
|
48
|
+
* **Buyer Persona Enrichment**
|
|
49
|
+
Every classification returns relevant buyer personas—select from a proprietary library of over 1,800 personas to enrich your analytics, personalization, or marketing automations.
|
|
50
|
+
Confidence scores and expanded context available.
|
|
51
|
+
|
|
52
|
+
* **High Scalability and Reliability**
|
|
53
|
+
Robust API supporting high throughput (rate limits adjustable upon request), with credit-based billing for predictable scaling.
|
|
54
|
+
|
|
55
|
+
* **Plug-and-Play Python Integration**
|
|
56
|
+
Simple, modern, and extensible Python API client.
|
|
57
|
+
See [Quickstart](#quickstart) for usage examples.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Table of Contents
|
|
62
|
+
|
|
63
|
+
* [Getting Started](#getting-started)
|
|
64
|
+
* [Authentication](#authentication)
|
|
65
|
+
* [API Usage](#api-usage)
|
|
66
|
+
|
|
67
|
+
* [Text Categorization](#text-categorization)
|
|
68
|
+
* [URL Categorization](#url-categorization)
|
|
69
|
+
* [Image Categorization](#image-categorization)
|
|
70
|
+
* [Advanced Options](#advanced-options)
|
|
71
|
+
|
|
72
|
+
* [Buyer Personas and Confidence Scores](#buyer-personas-and-confidence-scores)
|
|
73
|
+
* [Context Expansion](#context-expansion)
|
|
74
|
+
* [Error Handling](#error-handling)
|
|
75
|
+
* [Best Practices](#best-practices)
|
|
76
|
+
* [Integration Examples](#integration-examples)
|
|
77
|
+
* [Contact & Support](#contact--support)
|
|
78
|
+
* [Related Services](#related-services)
|
|
79
|
+
* [References](#references)
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## Getting Started
|
|
84
|
+
|
|
85
|
+
Install the package via PyPI:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
pip install productcategorization
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Or add it to your `requirements.txt` for automatic deployment.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Authentication
|
|
96
|
+
|
|
97
|
+
All API access is secured by a personal API key.
|
|
98
|
+
To obtain your API key:
|
|
99
|
+
|
|
100
|
+
1. Sign up and purchase a subscription at [www.productcategorization.com](https://www.productcategorization.com/pricing.php
|
|
101
|
+
3. Provide the API key in every request (see examples).
|
|
102
|
+
|
|
103
|
+
> **Note:** Never share your API key publicly. Store it securely as an environment variable or in your configuration files.
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## API Usage
|
|
108
|
+
|
|
109
|
+
### Text Categorization
|
|
110
|
+
|
|
111
|
+
Classify any product text (title, description, or keyword) in a single line:
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
from productcategorization import ProductCategorizationAPI
|
|
115
|
+
|
|
116
|
+
api = ProductCategorizationAPI(api_key="your_api_key")
|
|
117
|
+
result = api.categorize_text("Fluorescent Highlighters 3pc Yellow")
|
|
118
|
+
print(result)
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Sample Response:**
|
|
122
|
+
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"total_credits": 100044,
|
|
126
|
+
"remaining_credits": 33075,
|
|
127
|
+
"language": "en",
|
|
128
|
+
"classification": "Office Supplies > Office Instruments > Writing & Drawing Instruments",
|
|
129
|
+
"buyer_personas": [
|
|
130
|
+
"Business Professional", "Office Professional", "Administrative Coordinator", ...
|
|
131
|
+
],
|
|
132
|
+
"buyer_personas_confidence_selection": {
|
|
133
|
+
"Office Professional": 0.9,
|
|
134
|
+
"Business Professional": 0.8,
|
|
135
|
+
...
|
|
136
|
+
},
|
|
137
|
+
"ID": "977",
|
|
138
|
+
"status": 200
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Parameters:**
|
|
143
|
+
|
|
144
|
+
* `query` (str): Product text for categorization.
|
|
145
|
+
* `confidence` (optional, int): Set to `1` to include confidence scores for each persona.
|
|
146
|
+
* `expand_context` (optional, int): Set to `1` to auto-generate expanded context for short/ambiguous texts.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
### URL Categorization
|
|
151
|
+
|
|
152
|
+
You can also classify products by URL, leveraging our AI’s ability to extract relevant text and metadata:
|
|
153
|
+
|
|
154
|
+
```python
|
|
155
|
+
result = api.categorize_url("https://www.apple.com")
|
|
156
|
+
print(result)
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**Sample Python (requests):**
|
|
160
|
+
|
|
161
|
+
```python
|
|
162
|
+
import requests
|
|
163
|
+
|
|
164
|
+
payload = {'query': 'www.apple.com', 'api_key': 'your_api_key', 'data_type': 'url'}
|
|
165
|
+
response = requests.post("https://www.productcategorization.com/api/iab/iab_web_content_filtering_url.php", data=payload)
|
|
166
|
+
print(response.json())
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
### Image Categorization
|
|
172
|
+
|
|
173
|
+
Classify products using image URLs or local image files (Shopify Taxonomy + attribute extraction):
|
|
174
|
+
|
|
175
|
+
```python
|
|
176
|
+
result = api.categorize_image(image_url="https://images.com/product.jpg", text="Product title")
|
|
177
|
+
print(result)
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
**Example Function:**
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
import requests
|
|
184
|
+
import io
|
|
185
|
+
|
|
186
|
+
def call_api(image_url, text, api_key):
|
|
187
|
+
api_endpoint = 'https://www.productcategorization.com/api/ecommerce/ecommerce_shopify_image.php'
|
|
188
|
+
response = requests.get(image_url)
|
|
189
|
+
if response.status_code != 200:
|
|
190
|
+
return {'error': 'Failed to download image'}
|
|
191
|
+
image_file = io.BytesIO(response.content)
|
|
192
|
+
data = {'ip': '0', 'api_key': api_key, 'login': '0', 'text': text}
|
|
193
|
+
files = {'image': ('image.jpg', image_file, 'image/jpeg')}
|
|
194
|
+
response = requests.post(api_endpoint, data=data, files=files)
|
|
195
|
+
return response.json()
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
---
|
|
199
|
+
|
|
200
|
+
## Advanced Options
|
|
201
|
+
|
|
202
|
+
### Buyer Personas and Confidence Scores
|
|
203
|
+
|
|
204
|
+
Our AI delivers a unique set of buyer personas for every product—ideal for market analysis, targeted marketing, or persona-based analytics.
|
|
205
|
+
Enable confidence scoring to obtain relevance weights for each persona:
|
|
206
|
+
|
|
207
|
+
```python
|
|
208
|
+
result = api.categorize_text("Eco-Friendly Notebook", confidence=1)
|
|
209
|
+
print(result["buyer_personas_confidence_selection"])
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Context Expansion
|
|
213
|
+
|
|
214
|
+
For short or ambiguous inputs, enable `expand_context=1` to let our AI generate an enhanced description for improved classification accuracy:
|
|
215
|
+
|
|
216
|
+
```python
|
|
217
|
+
result = api.categorize_text("3pc Yellow Highlighters", expand_context=1)
|
|
218
|
+
print(result["expanded_context"])
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## Error Handling
|
|
224
|
+
|
|
225
|
+
All API responses include a `status` code for programmatic error handling:
|
|
226
|
+
|
|
227
|
+
| Status | Meaning |
|
|
228
|
+
| ------ | ---------------------------------------- |
|
|
229
|
+
| 200 | Request was successful |
|
|
230
|
+
| 400 | Request malformed (check parameters) |
|
|
231
|
+
| 401 | Invalid API key (check or purchase key) |
|
|
232
|
+
| 403 | Quota exhausted (upgrade or add credits) |
|
|
233
|
+
|
|
234
|
+
Example error handling in Python:
|
|
235
|
+
|
|
236
|
+
```python
|
|
237
|
+
if result["status"] != 200:
|
|
238
|
+
print(f"API Error: {result.get('message', 'Unknown error')}")
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## Best Practices
|
|
244
|
+
|
|
245
|
+
* **Monitor Remaining Credits:** Every response includes `total_credits` and `remaining_credits`. Plan your usage to avoid interruptions.
|
|
246
|
+
* **Respect Rate Limits:** Default is 60 requests per minute. Contact support for higher needs.
|
|
247
|
+
* **Secure Your API Key:** Do not embed directly in code if publishing open-source.
|
|
248
|
+
* **Use Context Expansion When Needed:** For short/ambiguous product titles, enable `expand_context`.
|
|
249
|
+
* **Batch Requests:** For large datasets, consider batching requests and handling quota gracefully.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Integration Examples
|
|
254
|
+
|
|
255
|
+
### Python Example
|
|
256
|
+
|
|
257
|
+
```python
|
|
258
|
+
from productcategorization import ProductCategorizationAPI
|
|
259
|
+
|
|
260
|
+
api = ProductCategorizationAPI(api_key="your_api_key")
|
|
261
|
+
result = api.categorize_text("Fluorescent Highlighters 3pc Yellow")
|
|
262
|
+
print(result["classification"])
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### JavaScript Example
|
|
266
|
+
|
|
267
|
+
```javascript
|
|
268
|
+
const apiBaseUrl = "https://www.productcategorization.com/api/ecommerce/ecommerce_category6_get.php?";
|
|
269
|
+
const apiKey = "your_api_key";
|
|
270
|
+
const queryText = "Fluorescent Highlighters 3pc Yellow";
|
|
271
|
+
const encodedQueryText = encodeURIComponent(queryText);
|
|
272
|
+
const finalUrl = `${apiBaseUrl}query=${encodedQueryText}&api_key=${apiKey}`;
|
|
273
|
+
|
|
274
|
+
fetch(finalUrl)
|
|
275
|
+
.then(response => response.json())
|
|
276
|
+
.then(data => console.log(data));
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Ruby Example
|
|
280
|
+
|
|
281
|
+
```ruby
|
|
282
|
+
require 'uri'
|
|
283
|
+
require 'net/http'
|
|
284
|
+
|
|
285
|
+
api_base_url = "https://www.productcategorization.com/api/ecommerce/ecommerce_category6_get.php"
|
|
286
|
+
api_key = "your_api_key"
|
|
287
|
+
query_text = "Fluorescent Highlighters 3pc Yellow"
|
|
288
|
+
|
|
289
|
+
encoded_query = URI.encode_www_form_component(query_text)
|
|
290
|
+
url = URI("#{api_base_url}?query=#{encoded_query}&api_key=#{api_key}")
|
|
291
|
+
|
|
292
|
+
response = Net::HTTP.get(url)
|
|
293
|
+
puts response
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### C# Example
|
|
297
|
+
|
|
298
|
+
```csharp
|
|
299
|
+
using System;
|
|
300
|
+
using System.Net.Http;
|
|
301
|
+
using System.Threading.Tasks;
|
|
302
|
+
|
|
303
|
+
class Program {
|
|
304
|
+
static async Task Main(string[] args) {
|
|
305
|
+
var apiBaseUrl = "https://www.productcategorization.com/api/ecommerce/ecommerce_category6_get.php?";
|
|
306
|
+
var apiKey = "your_api_key";
|
|
307
|
+
var queryText = "Fluorescent Highlighters 3pc Yellow";
|
|
308
|
+
var encodedQueryText = Uri.EscapeDataString(queryText);
|
|
309
|
+
var finalUrl = $"{apiBaseUrl}query={encodedQueryText}&api_key={apiKey}";
|
|
310
|
+
|
|
311
|
+
using (HttpClient client = new HttpClient()) {
|
|
312
|
+
var response = await client.GetStringAsync(finalUrl);
|
|
313
|
+
Console.WriteLine(response);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## Contact & Support
|
|
322
|
+
|
|
323
|
+
Need a higher rate limit, a custom classifier, or additional support?
|
|
324
|
+
Visit [Contact](https://www.productcategorization.com/contact), or email support via your account dashboard.
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## Related Services
|
|
329
|
+
|
|
330
|
+
Domain review becomes easier when analysts can reference a [domain classification database](https://webfilteringdatabase.com) for consistent category data. Strong classification coverage is useful for c
|
|
331
|
+
ompliance checks and internal security reviews. To operationalize those results, organizations may deploy a [managed filtering platform](https://webfilteringservice.com) across their networks.
|
|
332
|
+
|
|
333
|
+
Leverage our broader suite of AI-powered APIs to cover every aspect of your business’s data intelligence and privacy needs:
|
|
334
|
+
|
|
335
|
+
* **[Live Video Anonymization](https://www.anonymizationapi.com) – live video anonymization:**
|
|
336
|
+
Protect privacy with automatic anonymization of faces and sensitive objects in live video streams, supporting GDPR compliance and safeguarding user identities.
|
|
337
|
+
|
|
338
|
+
|
|
339
|
+
* **[Domain Categorization Data](https://www.urlcategorizationdatabase.com) – domain categorization data:**
|
|
340
|
+
Access the world’s largest database of categorized domains for cybersecurity, web filtering, and content safety.
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
Our APIs integrate seamlessly with your product workflows, providing reliable, scalable, and secure endpoints for your business logic.
|
|
344
|
+
|
|
345
|
+
For organizations operating in the education sector, product classification often feeds into broader content-safety workflows — a [CIPA-compliant filtering database](https://www.cipawebfiltering.com) with over 120 million categorized domains helps K-12 districts and libraries enforce acceptable-use policies required by federal law. Cybersecurity is equally critical in e-commerce environments where phishing pages impersonate legitimate retailers, and a [real-time phishing intelligence](https://www.phishingdetectionapi.com) feed of 390,000+ verified malicious domains enables platforms to warn buyers before they land on a fraudulent storefront. Combining product-level classification with domain-level threat detection creates a layered defense that protects both brand reputation and end-user safety.
|
|
346
|
+
|
|
347
|
+
---
|
|
348
|
+
|
|
349
|
+
## References & Further Reading
|
|
350
|
+
|
|
351
|
+
For best-in-class taxonomy, AI, and categorization research, explore:
|
|
352
|
+
|
|
353
|
+
* [Stanford AI Lab](https://ai.stanford.edu)
|
|
354
|
+
* [MIT CSAIL](https://www.csail.mit.edu)
|
|
355
|
+
* [Berkeley AI Research](https://bair.berkeley.edu)
|
|
356
|
+
* [Oxford Internet Institute](https://www.oii.ox.ac.uk)
|
|
357
|
+
* [UCL Centre for Artificial Intelligence](https://www.ucl.ac.uk/ai)
|
|
358
|
+
* [Google AI Blog](https://ai.googleblog.com/)
|
|
359
|
+
* [Microsoft Research](https://www.microsoft.com/en-us/research/)
|
|
360
|
+
* [arXiv Machine Learning](https://arxiv.org/list/cs.LG/recent)
|
|
361
|
+
|
|
362
|
+
For taxonomy standards and e-commerce data:
|
|
363
|
+
|
|
364
|
+
* [Google Shopping Taxonomy](https://support.google.com/merchants/answer/6324436)
|
|
365
|
+
* [Shopify Product Taxonomy](https://github.com/Shopify/product-taxonomy)
|
|
366
|
+
|
|
367
|
+
---
|
|
368
|
+
|
|
369
|
+
## License
|
|
370
|
+
|
|
371
|
+
This library is distributed under the MIT License.
|
|
372
|
+
|
|
373
|
+
---
|
|
374
|
+
|
|
375
|
+
## Disclaimer
|
|
376
|
+
|
|
377
|
+
This project is unaffiliated with Google, Shopify, or Amazon.
|
|
378
|
+
All trademarks are property of their respective owners.
|
|
379
|
+
|
|
380
|
+
---
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
Classification needs have expanded beyond products: [AI tool domain classification](https://www.aitoolsblocklist.com) is now a common requirement for security and compliance teams that must inventory and control generative-AI usage. A dedicated, daily-refreshed list of AI-tool domains with functional categories lets network products offer per-category AI policies out of the box. It pairs naturally with the taxonomy-driven approach described in this package.
|
|
384
|
+
|
|
385
|
+
# `__init__.py` Example
|
|
386
|
+
|
|
387
|
+
```python
|
|
388
|
+
import requests
|
|
389
|
+
|
|
390
|
+
class ProductCategorizationAPI:
|
|
391
|
+
def __init__(self, api_key):
|
|
392
|
+
self.api_key = api_key
|
|
393
|
+
self.base_url = "https://www.productcategorization.com/api/"
|
|
394
|
+
|
|
395
|
+
def categorize_text(self, text, confidence=0, expand_context=0):
|
|
396
|
+
params = {
|
|
397
|
+
"query": text,
|
|
398
|
+
"api_key": self.api_key,
|
|
399
|
+
"confidence": str(confidence),
|
|
400
|
+
"expand_context": str(expand_context)
|
|
401
|
+
}
|
|
402
|
+
response = requests.get(self.base_url + "ecommerce/ecommerce_category6_get.php", params=params)
|
|
403
|
+
return response.json()
|
|
404
|
+
|
|
405
|
+
def categorize_url(self, url):
|
|
406
|
+
payload = {
|
|
407
|
+
'query': url,
|
|
408
|
+
'api_key': self.api_key,
|
|
409
|
+
'data_type': 'url'
|
|
410
|
+
}
|
|
411
|
+
headers = {
|
|
412
|
+
'Content-Type': 'application/x-www-form-urlencoded'
|
|
413
|
+
}
|
|
414
|
+
response = requests.post(self.base_url + "iab/iab_web_content_filtering_url.php", data=payload, headers=headers)
|
|
415
|
+
return response.json()
|
|
416
|
+
|
|
417
|
+
def categorize_image(self, image_url, text="", ip="0", login="0"):
|
|
418
|
+
# Download image to memory
|
|
419
|
+
image_response = requests.get(image_url)
|
|
420
|
+
if image_response.status_code != 200:
|
|
421
|
+
return {'error': 'Failed to download image'}
|
|
422
|
+
import io
|
|
423
|
+
image_file = io.BytesIO(image_response.content)
|
|
424
|
+
data = {
|
|
425
|
+
'ip': ip,
|
|
426
|
+
'api_key': self.api_key,
|
|
427
|
+
'login': login,
|
|
428
|
+
'text': text
|
|
429
|
+
}
|
|
430
|
+
files = {
|
|
431
|
+
'image': ('image.jpg', image_file, 'image/jpeg')
|
|
432
|
+
}
|
|
433
|
+
response = requests.post(self.base_url + "ecommerce/ecommerce_shopify_image.php", data=data, files=files)
|
|
434
|
+
return response.json()
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
---
|
|
438
|
+
* [AI tool domain classification](https://www.aitoolsblocklist.com)
|
|
@@ -313,15 +313,9 @@ Domain review becomes easier when analysts can reference a [domain classificatio
|
|
|
313
313
|
|
|
314
314
|
Leverage our broader suite of AI-powered APIs to cover every aspect of your business’s data intelligence and privacy needs:
|
|
315
315
|
|
|
316
|
-
* **[Comment Moderation API](https://www.contentmoderationapi.net) – comment moderation api:**
|
|
317
|
-
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.
|
|
318
|
-
|
|
319
316
|
* **[Live Video Anonymization](https://www.anonymizationapi.com) – live video anonymization:**
|
|
320
317
|
Protect privacy with automatic anonymization of faces and sensitive objects in live video streams, supporting GDPR compliance and safeguarding user identities.
|
|
321
318
|
|
|
322
|
-
* **[Text Redaction API](https://www.redactionapi.net) – text redaction api:**
|
|
323
|
-
Redact personal data, financial information, or any sensitive fields from documents at scale using our high-precision redaction API.
|
|
324
|
-
|
|
325
319
|
|
|
326
320
|
* **[Domain Categorization Data](https://www.urlcategorizationdatabase.com) – domain categorization data:**
|
|
327
321
|
Access the world’s largest database of categorized domains for cybersecurity, web filtering, and content safety.
|
|
@@ -329,6 +323,8 @@ Leverage our broader suite of AI-powered APIs to cover every aspect of your busi
|
|
|
329
323
|
|
|
330
324
|
Our APIs integrate seamlessly with your product workflows, providing reliable, scalable, and secure endpoints for your business logic.
|
|
331
325
|
|
|
326
|
+
For organizations operating in the education sector, product classification often feeds into broader content-safety workflows — a [CIPA-compliant filtering database](https://www.cipawebfiltering.com) with over 120 million categorized domains helps K-12 districts and libraries enforce acceptable-use policies required by federal law. Cybersecurity is equally critical in e-commerce environments where phishing pages impersonate legitimate retailers, and a [real-time phishing intelligence](https://www.phishingdetectionapi.com) feed of 390,000+ verified malicious domains enables platforms to warn buyers before they land on a fraudulent storefront. Combining product-level classification with domain-level threat detection creates a layered defense that protects both brand reputation and end-user safety.
|
|
327
|
+
|
|
332
328
|
---
|
|
333
329
|
|
|
334
330
|
## References & Further Reading
|