import ContextDev from 'context.dev';
const client = new ContextDev({
apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted
});
const response = await client.ai.extractProduct({ url: 'https://example.com' });
console.log(response.is_product_page);{
"is_product_page": true,
"platform": "amazon",
"product": {
"name": "<string>",
"description": "<string>",
"features": [
"<string>"
],
"target_audience": [
"<string>"
],
"tags": [
"<string>"
],
"images": [
"<string>"
],
"price": 123,
"currency": "<string>",
"billing_frequency": "monthly",
"pricing_model": "per_seat",
"url": "<string>",
"category": "<string>",
"image_url": "<string>"
}
}Beta feature: Given a single URL, determines if it is a product detail page, classifies the platform/product type, and extracts the product information. Supports Amazon, TikTok Shop, Etsy, and generic ecommerce sites.
import ContextDev from 'context.dev';
const client = new ContextDev({
apiKey: process.env['CONTEXT_DEV_API_KEY'], // This is the default and can be omitted
});
const response = await client.ai.extractProduct({ url: 'https://example.com' });
console.log(response.is_product_page);{
"is_product_page": true,
"platform": "amazon",
"product": {
"name": "<string>",
"description": "<string>",
"features": [
"<string>"
],
"target_audience": [
"<string>"
],
"tags": [
"<string>"
],
"images": [
"<string>"
],
"price": 123,
"currency": "<string>",
"billing_frequency": "monthly",
"pricing_model": "per_seat",
"url": "<string>",
"category": "<string>",
"image_url": "<string>"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Successful response
Whether the given URL is a product detail page
The detected ecommerce platform, or null if not a product page
amazon, tiktok_shop, etsy, generic The extracted product data, or null if not a product page
Show child attributes
Was this page helpful?