1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "businessName": "TechCorp Inc",
12 "businessDescription": "TechCorp Inc is a leading technology company specializing in innovative software solutions for small and medium businesses since 2010.",
13 "pressReleaseCategory": "product launch",
14 "subjectPressRelease": "Launch of our new AI-powered project management software that helps teams increase productivity by 40%",
15 "keyFeatures": "AI-powered task automation, Real-time collaboration, Advanced analytics dashboard, 40% productivity increase, Integration with 50+ popular tools",
16 "people": "John Smith, CEO of TechCorp Inc",
17 "businessUrl": "https://www.techcorpexampleinc.com/",
18 "location": "San Francisco, CA",
19 "date": "January 15, 2025",
20 "tone": "professional",
21 "language": "English"
22};
23
24
25const run = await client.actor("onescales/press-release-ai-writer").call(input);
26
27
28console.log('Results from dataset');
29console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
30const { items } = await client.dataset(run.defaultDatasetId).listItems();
31items.forEach((item) => {
32 console.dir(item);
33});
34
35