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>"
],
"sku": "<string>",
"price": 123,
"currency": "<string>",
"billing_frequency": "monthly",
"pricing_model": "per_seat",
"url": "<string>",
"category": "<string>",
"image_url": "<string>"
}
}Given a single URL, determines if it is a product page and extracts the product information.
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>"
],
"sku": "<string>",
"price": 123,
"currency": "<string>",
"billing_frequency": "monthly",
"pricing_model": "per_seat",
"url": "<string>",
"category": "<string>",
"image_url": "<string>"
}
}10 CreditsDocumentation Index
Fetch the complete documentation index at: https://docs.context.dev/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The product page URL to extract product data from.
Optional timeout in milliseconds for the request. Maximum allowed value is 300000ms (5 minutes).
1000 <= x <= 300000Return a cached result if a prior scrape for the same parameters exists and is younger than this many milliseconds. Defaults to 7 days (604800000 ms) when omitted. Max is 30 days (2592000000 ms). Set to 0 to always scrape fresh.
0 <= x <= 2592000000Successful 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?