Skip to content

Use Cases

ZCode edited this page Oct 22, 2026 · 3 revisions

Use Cases

Real automation patterns built on the Sorftime Data CLI. Full recipe book: resources/use-cases.md in the repo.

1. Batch product intelligence (200 ASINs)

# 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',''))]))
"

2. Category trend monitoring (daily pull)

# 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).jsonl

3. Keyword reverse-lookup for a competitor ASIN

sorftime 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

4. Hijacker monitoring setup

# 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

5. Cross-platform price comparison

# 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})'

6. 1688 sourcing price check

sorftime api ProductSearchFromName '{"name":"iRobot Roomba"}' --domain 26 | grep -v "^info:" | jq .

7. TikTok creator & video analytics (US only, domain=301)

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.

8. Realtime SERP collection for any keyword (async trio)

# 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.

Patterns to remember

  • Always sleep 1 between batch calls (rate-limit errors: 500/501/694) — batch.sh does this by default
  • Large payloads (CategoryTree ~10MB) → save to a local file and jq the node you need; never load in full
  • Field names are non-standard — check resources/_field_aliases.md when a field seems missing