1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "assessments": [
12 {
13 "actorRef": {
14 "actorId": "example-actor-id",
15 "slug": "page-metadata-extractor",
16 "name": "Page Metadata Extractor"
17 },
18 "correlationId": "example-1",
19 "manifest": {
20 "name": "page-metadata-extractor",
21 "title": "Page Metadata Extractor",
22 "description": "Turn public webpage URLs into structured metadata records.",
23 "version": "0.1"
24 },
25 "inputSchema": {
26 "type": "object",
27 "properties": {
28 "urls": {
29 "type": "array",
30 "items": {
31 "type": "string"
32 }
33 }
34 },
35 "required": [
36 "urls"
37 ],
38 "additionalProperties": false
39 },
40 "exampleInput": {
41 "urls": [
42 "https://example.com"
43 ]
44 },
45 "pricing": {
46 "pricingModel": "PAY_PER_EVENT",
47 "events": {
48 "page-processed": {
49 "priceUsd": 0.001
50 }
51 }
52 }
53 }
54 ]
55};
56
57
58const run = await client.actor("skilled_glee/actor-quality-guard").call(input);
59
60
61console.log('Results from dataset');
62console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
63const { items } = await client.dataset(run.defaultDatasetId).listItems();
64items.forEach((item) => {
65 console.dir(item);
66});
67
68