import Anchorbrowser from 'anchorbrowser';
const anchorClient = new Anchorbrowser({
apiKey: process.env.ANCHORBROWSER_API_KEY
});
const response = await anchorClient.agent.task(
'Find the pricing information and extract the plan details',
{
taskOptions: {
url: 'https://example.com/pricing',
agent: 'openai-cua',
// model: 'computer-use-preview', // Default model
maxSteps: 25,
outputSchema: {
type: 'object',
properties: {
plans: {
type: 'array',
items: {
type: 'object',
properties: {
name: { type: 'string' },
price: { type: 'string' },
features: { type: 'array', items: { type: 'string' } }
}
}
}
}
}
}
}
);
console.log(response);