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.aiQuery({
data_to_extract: [
{
datapoint_description: 'datapoint_description',
datapoint_example: 'datapoint_example',
datapoint_name: 'datapoint_name',
datapoint_type: 'text',
},
],
domain: 'domain',
});
console.log(response.data_extracted);{
"status": "<string>",
"domain": "<string>",
"urls_analyzed": [
"<string>"
],
"data_extracted": [
{
"datapoint_name": "<string>",
"datapoint_value": "<string>"
}
]
}Use AI to extract specific data points from a brandās website. The AI will crawl the website and extract the requested information based on the provided data points.
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.aiQuery({
data_to_extract: [
{
datapoint_description: 'datapoint_description',
datapoint_example: 'datapoint_example',
datapoint_name: 'datapoint_name',
datapoint_type: 'text',
},
],
domain: 'domain',
});
console.log(response.data_extracted);{
"status": "<string>",
"domain": "<string>",
"urls_analyzed": [
"<string>"
],
"data_extracted": [
{
"datapoint_name": "<string>",
"datapoint_value": "<string>"
}
]
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The domain name to analyze
Array of data points to extract from the website
Show child attributes
Optional timeout in milliseconds for the request. If the request takes longer than this value, it will be aborted with a 408 status code. Maximum allowed value is 300000ms (5 minutes).
1000 <= x <= 300000Optional object specifying which pages to analyze
Show child attributes
Was this page helpful?