$API_TOKEN=<YOUR_API_TOKEN>
$cat > input.json << 'EOF'
<{
< "pathToImageUrls": "images",
< "fileNameFunction": "({url, md5}) => md5(url)",
< "uploadTo": "zip-file",
< "preDownloadFunction": "/* Example: We get rid of the items with price 0\n({ data }) => data.filter((item) => item.price > 0)\n*/",
< "postDownloadFunction": "/* Example: We remove items without any successfully uploaded images.\n We also remove any image URLs that were not uploaded\n \n ({ data, state }) => {\n return data.reduce((newData, item) => {\n const downloadedImages = item.images.filter((imageUrl) => {\n return state[imageUrl] && state[imageUrl].imageUploaded;\n });\n \n if (downloadedImages.length === 0) {\n return newData;\n }\n \n return newData.concat({ ...item, images: downloadedImages });\n }, []);\n}\n*/",
< "imageCheckType": "content-type",
< "proxyConfiguration": {
< "useApifyProxy": true
< }
<}
<EOF
$curl "https://api.apify.com/v2/acts/lukaskrivka~images-download-upload/runs?token=$API_TOKEN" \
< -X POST \
< -d @input.json \
< -H 'Content-Type: application/json'