Small Node + TypeScript CLI scripts for GTM workflows on top of the SpreshApp public API.
npm installRequired environment variables:
export SPRESHAPP_API_KEY=sk_sprs_xxxGet your API key from:
https://www.spreshapp.com/app/api-access
Optional:
export SPRESHAPP_BASE_URL=https://api.spreshapp.com
export OUTPUT_DIR=./outLead generation from a keyword:
node dist/src/cli.js lead-gen --query "electric toothbrush" --max-ads 50 --format csvCompetitor analysis:
node dist/src/cli.js competitor-analysis --brand "Hismile" --brand "Boka"Server mode:
node dist/src/cli.js serve --port 4040Example requests:
curl -X POST http://127.0.0.1:4040/lead-gen \
-H 'content-type: application/json' \
-d '{"query":"electric toothbrush","maxAds":25}'curl -X POST http://127.0.0.1:4040/competitor-analysis \
-H 'content-type: application/json' \
-d '{"brands":["Hismile","Boka"],"maxAdsPerBrand":100}'Set "writeOutputs": true in the JSON payload if you also want files written into out/.
npm run build
npm test