Repository navigation
Use Cases
ZCode edited this page Oct 22, 2026
·
3 revisions
Real automation patterns built on the Sorftime Data CLI. Full recipe book: resources/use-cases.md in the repo.
# asins.txt: one ASIN per line
bash scripts/batch.sh ProductRequest asins.txt --param asin --domain 1 --out products.jsonl
# Extract the key fields into CSV
cat products.jsonl | python3 -c "
import json, sys
for line in sys.stdin:
d = json.loads(line).get('data', {})
print(','.join([d.get('Asin',''), str(d.get('SalesPrice','')), str(d.get('ListingSalesVolumeOfMonth','')), str(d.get('Ratings',''))]))
"# Category Trend for a node, appended to a local log daily (cron / launchd)
sorftime api CategoryTrend '{"nodeId":"3743561"}' --domain 1 \
| grep -v "^info:" | jq . >> category-trend-$(date +%F).jsonlsorftime api ASINRequestKeyword '{"asin":"B0CVM8TXHP","pageSize":100}' --domain 1 \
| grep -v "^info:" | jq '.data[0:20]'
# → ranked keyword list the ASIN ranks for — competitor keyword strategy in one call# Register a seller/hijacker monitoring task for an ASIN
sorftime api ProductSellerSubscription '{"asin":"B0CVM8TXHP"}' --domain 1
# Check task status, then collect results
sorftime api ProductSellerTasks '{"taskId":"<taskId>"}' --domain 1
sorftime api ProductSellerDataCollect '{"taskId":"<taskId>"}' --domain 1# Same keyword across Amazon (domain 1) and Walmart (domain 28)
sorftime api ProductSearch '{"keyword":"bluetooth earbuds"}' --domain 1 | grep -v "^info:" | jq '.data[0:5] | map({Asin, SalesPrice})'
sorftime api ProductSearch '{"keyword":"bluetooth earbuds"}' --domain 28 | grep -v "^info:" | jq '.data[0:5] | map({Asin, SalesPrice})'sorftime api ProductSearchFromName '{"name":"iRobot Roomba"}' --domain 26 | grep -v "^info:" | jq .sorftime api AuthorRequest '{"authorId":"<authorId>"}' --domain 301 | grep -v "^info:" | jq .
sorftime api VideoRequest '{"videoId":"<videoId>"}' --domain 301 | grep -v "^info:" | jq .
⚠️ AuthorRequest / VideoRequest / VideoTagSearch are US-site only — other domains return 401.
# 1. Submit — live Amazon search-results collection (any keyword, batch supported)
# keyword is an ARRAY; mode 0=PC/1=mobile; area = mode-specific postal code; page = ceiling
sorftime api KeywordSearchRealtimeRequest '{"keyword":["power bank"],"mode":0,"area":"10041","page":1}' --domain 1
# → Data: ["power bank:65087"]
# 2. Poll until Status flips 99 → 0 (free; takes minutes to hours — GB ~13 min, US ~35-47 min observed)
sorftime api KeywordSearchRealtimeRequestStatusQuery '{}' --domain 1
# 3. Fetch — flat SERP snapshot as 13-column tuples (ASIN/image/title/ad flag/badge/position/…)
sorftime api KeywordSearchRealtimeRequestCollection '{"taskId":"65087"}' --domain 1
⚠️ All four submit params are required; PC area codes are rejected in mobile mode and vice versa. Full column map:resources/amazon-keyword-api.md§5.3. 8 sites: US/GB/DE/FR/CA/JP/ES/IT.
-
Always
sleep 1between batch calls (rate-limit errors: 500/501/694) —batch.shdoes this by default -
Large payloads (CategoryTree ~10MB) → save to a local file and
jqthe node you need; never load in full -
Field names are non-standard — check
resources/_field_aliases.mdwhen a field seems missing