Analyze baseball Statcast data to identify and score "sword swings"
POST /swords
{
"date": "YYYY-MM-DD"
}
https://swordfinder.replit.app/swords
POST
Content-Type: application/json
{"date": "2025-05-24"}
sword_score = 0.35×(60-bat_speed)/60 + 0.25×swing_tilt/60 + 0.25×intercept_y/50 + 0.15×zone_penalty
Normalized to 50-100 scale, returns top 5 swings
https://swordfinder.replit.app/swords
curl -X POST https://swordfinder.replit.app/swords \
-H "Content-Type: application/json" \
-d '{"date": "2025-05-24"}'
const response = await fetch('https://swordfinder.replit.app/swords', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
date: '2025-05-24'
})
});
const data = await response.json();
console.log(data);
import requests
response = requests.post(
'https://swordfinder.replit.app/swords',
json={'date': '2025-05-24'}
)
data = response.json()
print(data)
{
"success": true,
"count": 5,
"date": "2025-05-24",
"data": [
{
"play_id": "252064aa-13a1-3abe-9a90-f25156a519e8",
"game_pk": 777796,
"player_name": "Herrin, Tim",
"pitch_type": "CU",
"pitch_name": "Curveball",
"release_speed": 79.6,
"release_spin_rate": 2408,
"plate_x": -0.08,
"plate_z": 1.37,
"sz_top": 3.53,
"sz_bot": 1.65,
"bat_speed": 34.4,
"swing_path_tilt": 46.1,
"attack_angle": 18.0,
"intercept_ball_minus_batter_pos_y_inches": 30.1,
"description": "swinging_strike",
"events": "strikeout",
"inning": 9,
"balls": 2,
"strikes": 2,
"at_bat_number": 72,
"pitch_number": 5,
"home_team": "DET",
"away_team": "CLE",
"batter": 669234,
"pitcher": 682120,
"video_url": "https://baseballsavant.mlb.com/sporty-videos?playId=252064aa-13a1-3abe-9a90-f25156a519e8",
"download_url": "https://sporty-clips.mlb.com/...encrypted.mp4",
"sword_score": 100.0
}
]
}