1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "text": "Apify is a cloud platform for web scraping and browser automation. Developers build Actors that extract structured data from websites, monitor prices, and feed machine learning pipelines. In 2024 the company expanded its Store with thousands of ready-made tools used by businesses in Europe, North America and Asia.Apify is a cloud platform for web scraping and browser automation. Developers build Actors that extract structured data from websites, monitor prices, and feed machine learning pipelines. In 2024 the company expanded its Store with thousands of ready-made tools used by businesses in Europe, North America and Asia.Apify is a cloud platform for web scraping and browser automation. Developers build Actors that extract structured data from websites, monitor prices, and feed machine learning pipelines. In 2024 the company expanded its Store with thousands of ready-made tools used by businesses in Europe, North America and Asia.",
12 "texts": []
13};
14
15
16const run = await client.actor("hipersoft/text-splitter-chunker").call(input);
17
18
19console.log('Results from dataset');
20console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
21const { items } = await client.dataset(run.defaultDatasetId).listItems();
22items.forEach((item) => {
23 console.dir(item);
24});
25
26