Get up and running with professional golf data in minutes. Our TypeScript-first client makes integration simple and powerful.
Sign up for Squad Golf and generate your API key from the dashboard.
Generate API KeyInstall our TypeScript client for the best development experience.
View InstallationGet tournament data and start building your golf application.
See ExamplesLearn about WebSocket subscriptions, caching, and React hooks.
View DocumentationFull-featured TypeScript client with caching, WebSocket support, and React hooks
npm install @squad-golf/api-client
Make direct HTTP requests to our REST API endpoints
curl -H "Authorization: Bearer your-api-key"
import { SquadGolfClient } from '@squad-golf/api-client';
// Initialize the client
const client = new SquadGolfClient({
apiKey: process.env.SQUAD_GOLF_API_KEY,
enableWebSocket: true, // Enable real-time updates
cache: {
ttl: 300, // Cache for 5 minutes
storage: 'memory' // or 'localStorage' in browser
}
});
// Get upcoming tournaments
const tournaments = await client.tournaments.getAllTournaments({
status: 'upcoming'
});
console.log(`Found ${tournaments.length} upcoming tournaments`);
// Get detailed tournament with leaderboard
const tournament = await client.tournaments.getTournament('t_abc123');
console.log(tournament.name, tournament.leaderboard?.players.length);
// Subscribe to live leaderboard updates
const unsubscribe = client.tournaments.subscribeToLeaderboard(
't_abc123',
(update) => {
console.log('Live update:', update.leaderboard.players[0]);
}
);
// Search for players
const players = await client.players.searchPlayers({
name: 'Tiger Woods',
limit: 10
});
// Get player rankings
const rankings = await client.rankings.getOWGRRankings({
limit: 50
});
SQUAD_GOLF_API_KEY=your_api_key_here
Authorization: Bearer your_api_key_here
Security Note: Never expose your API key in client-side code. Always make API calls from your server or use environment variables.