$API_TOKEN=<YOUR_API_TOKEN>
$cat > input.json << 'EOF'
<{
< "data": [
< {
< "id": 1,
< "product": "Wireless earbuds",
< "review": "Battery life is fantastic and the sound is crisp, but the charging case feels cheap and creaks."
< },
< {
< "id": 2,
< "product": "Standing desk",
< "review": "Arrived with a scratched top and the motor is loud enough to annoy my colleagues. Returned it."
< },
< {
< "id": 3,
< "product": "Coffee grinder",
< "review": "Does the job. Nothing special, nothing wrong, grinds evenly."
< }
< ],
< "prompt": "Classify the sentiment of this customer review as positive, neutral or negative. Then name the main topic in one to three words, and list up to three product aspects the customer mentions.\n\nProduct: {{product}}\nReview: {{review}}",
< "outputFields": [
< {
< "name": "sentiment",
< "type": "string",
< "description": "exactly one of: positive, neutral, negative"
< },
< {
< "name": "topic",
< "type": "string",
< "description": "what the review is mainly about, one to three words, e.g. battery life or delivery damage, never the product name"
< },
< {
< "name": "aspects",
< "type": "array",
< "description": "up to three short product aspects the customer mentions, e.g. battery life"
< }
< ],
< "exportFormats": [
< "csv"
< ]
<}
<EOF
$curl "https://api.apify.com/v2/actors/nerolabs~dataset-ai-enrich/runs?token=$API_TOKEN" \
< -X POST \
< -d @input.json \
< -H 'Content-Type: application/json'