Daily morning market scan — check USDA prices, find best buyers, and generate action plan for the day
Run this every morning before the grain desk opens. It checks live USDA data, identifies the best price opportunities across all crops, and generates a ready-to-use action plan.
https://crop-intel-api-production.up.railway.appUSDA_API_KEY)GEMINI_API_KEY)curl -s --max-time 10 "https://crop-intel-api-production.up.railway.app/health" | python3 -c "import json,sys; d=json.load(sys.stdin); print(f'API: {d.get(\"status\")} | Uptime: {int(d.get(\"uptime\",0))}s')"
Run each crop check individually:
Corn (ND):
curl -s --max-time 20 "https://crop-intel-api-production.up.railway.app/api/usda/grain-report?commodity=Corn&state=ND" | python3 -c "
import json,sys
d=json.load(sys.stdin)
s=d.get('data',{}).get('summary',{})
print(f'CORN | Source: {d.get(\"source\")} | Avg: \${s.get(\"avgPrice\",0):.2f}/bu | Basis: {s.get(\"avgBasis\",0):.0f}¢ | Bids: {s.get(\"bidCount\",0)} | Date: {s.get(\"reportDate\",\"?\")}')
"
Soybeans (ND):
curl -s --max-time 20 "https://crop-intel-api-production.up.railway.app/api/usda/grain-report?commodity=Soybeans&state=ND" | python3 -c "
import json,sys
d=json.load(sys.stdin)
s=d.get('data',{}).get('summary',{})
print(f'SOYBEANS | Source: {d.get(\"source\")} | Avg: \${s.get(\"avgPrice\",0):.2f}/bu | Basis: {s.get(\"avgBasis\",0):.0f}¢ | Bids: {s.get(\"bidCount\",0)}')
"
Wheat (ND):
curl -s --max-time 20 "https://crop-intel-api-production.up.railway.app/api/usda/grain-report?commodity=Wheat&state=ND" | python3 -c "
import json,sys
d=json.load(sys.stdin)
s=d.get('data',{}).get('summary',{})
print(f'WHEAT | Source: {d.get(\"source\")} | Avg: \${s.get(\"avgPrice\",0):.2f}/bu | Basis: {s.get(\"avgBasis\",0):.0f}¢ | Bids: {s.get(\"bidCount\",0)}')
"
Sunflowers:
curl -s --max-time 20 "https://crop-intel-api-production.up.railway.app/api/usda/sunflower-report" | python3 -c "
import json,sys
d=json.load(sys.stdin)
print(f'SUNFLOWERS | Source: {d.get(\"source\")} | Degraded: {d.get(\"degraded\")}')
"
For each crop, pull the buyer network and sort by net price:
curl -s --max-time 15 "https://crop-intel-api-production.up.railway.app/api/buyers?scope=all&crop=Yellow%20Corn" | python3 -c "
import json,sys
d=json.load(sys.stdin)
buyers=d.get('data',[])
# Sort by cash price descending
with_price = [b for b in buyers if b.get('cashBid') or b.get('postedBasis')]
print(f'=== YELLOW CORN: {len(buyers)} buyers ===')
for b in buyers[:5]:
phone = b.get('facilityPhone','No Phone')
rc = b.get('railConfidence',0) or 0
rail = 'BNSF' if rc >= 70 else 'Likely' if rc >= 40 else 'Truck'
print(f' {b[\"name\"]} ({b[\"state\"]}) | Phone: {phone} | Rail: {rail}')
"
Repeat for Soybeans, Wheat, Sunflowers.
For each promising buyer (score > 60), get Gemini explanation:
curl -s --max-time 30 -X POST "https://crop-intel-api-production.up.railway.app/api/ai/buyer-intel" \
-H "Content-Type: application/json" \
-d '{
"crop":"Yellow Corn",
"buyerData":{
"name":"BUYER_NAME",
"type":"BUYER_TYPE",
"city":"BUYER_CITY",
"state":"BUYER_STATE",
"netPrice":NET_PRICE,
"benchmarkPrice":BENCHMARK,
"railConfidence":RAIL_CONFIDENCE,
"hasPhone":true,
"freightCost":FREIGHT
},
"withExplanation":true
}'
Compile findings into a clear morning briefing:
Open the app at https://crop-intel-usa.vercel.app/ and verify:
Present findings as a table:
| Crop | Avg Price | Best Buyer | Net Price | vs Local | Action |
|---|---|---|---|---|---|
| Corn | $X.XX | BuyerName (ST) | $X.XX | +$0.XX | CALL |
| Soy | $X.XX | BuyerName (ST) | $X.XX | +$0.XX | CALL |