1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "texts": [
12 "The delivery was fast and the headphones sound great. The battery easily lasts a full working day, but the ear cushions get warm after an hour.",
13 "La calidad es excelente, pero el envío tardó dos semanas en llegar. El vendedor respondió rápido cuando pregunté por el seguimiento del paquete.",
14 "Le produit est arrivé cassé et le service client n'a jamais répondu à mes messages. J'ai dû ouvrir un litige pour être remboursé.",
15 "Sehr gutes Preis-Leistungs-Verhältnis. Die Einrichtung dauerte nur fünf Minuten, allerdings ist die Akkulaufzeit kürzer als angegeben.",
16 "Buscamos un desarrollador backend con experiencia en Python y bases de datos SQL. Trabajo remoto, contrato indefinido y horario flexible.",
17 "Appartement lumineux de deux pièces au troisième étage, proche du métro. Cuisine équipée, balcon et cave. Disponible à partir du 1er janvier.",
18 "Wir suchen eine erfahrene Buchhalterin in Teilzeit für unser Büro in Hamburg. Gute Deutsch- und Englischkenntnisse sind erforderlich.",
19 "Producto muy recomendable: funciona tal como se describe, la batería dura varios días y el tamaño es perfecto para llevarlo en el bolso."
20 ]
21};
22
23
24const run = await client.actor("gazidev/bulk-text-translator").call(input);
25
26
27console.log('Results from dataset');
28console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
29const { items } = await client.dataset(run.defaultDatasetId).listItems();
30items.forEach((item) => {
31 console.dir(item);
32});
33
34