Downloads API - Download Endpoints
Downloads API - Download Endpoints
Section titled “Downloads API - Download Endpoints”Download plugin JAR files directly from the API. All download endpoints return the actual plugin file ready to use.
Overview
Section titled “Overview”Download endpoints provide direct access to plugin JAR files. They return binary data with appropriate headers for file downloads.
Download Latest Version (by Server Software)
Section titled “Download Latest Version (by Server Software)”Download the latest plugin version for a specific server software (any Java version).
Endpoint: GET /api/plugin-versions/download/latest/:serverSoftware
Authentication: Not required (public endpoint)
URL Parameters
Section titled “URL Parameters”serverSoftware(required) - Server software name (case-insensitive)- Normal servers:
PaperMC,Spigot,Bukkit,Purpur,Quilt,LeafMC - Folia servers:
Folia,CanvasMC - Proxy servers:
BungeeCord,Waterfall,Velocity
- Normal servers:
Example Request
Section titled “Example Request”curl -O -J "https://api.statsly.org/api/plugin-versions/download/latest/PaperMC"Response
Section titled “Response”Returns a JAR file with the following headers:
Content-Type: application/java-archiveContent-Disposition: attachment; filename="Statsly-1.0.jar"Content-Length: <file-size>
Use the -O -J flags with curl to save the file with the correct filename. The -J flag respects the Content-Disposition header.
Example: PowerShell
Section titled “Example: PowerShell”$url = "https://api.statsly.org/api/plugin-versions/download/latest/PaperMC"$output = "plugins\Statsly.jar"
Invoke-WebRequest -Uri $url -OutFile $outputDownload Latest Version (by Server Software + Java Version)
Section titled “Download Latest Version (by Server Software + Java Version)”Download the latest plugin version for a specific server software and Java version combination.
Endpoint: GET /api/plugin-versions/download/latest/:serverSoftware/:javaVersion
Authentication: Not required (public endpoint)
URL Parameters
Section titled “URL Parameters”serverSoftware(required) - Server software namejavaVersion(required) - Java version (8,11,17, or21)
Example Request
Section titled “Example Request”curl -O -J "https://api.statsly.org/api/plugin-versions/download/latest/PaperMC/17"Response
Section titled “Response”Returns a JAR file download (same format as above).
Specifying a Java version ensures you get a version compatible with your server’s Java installation. This is recommended for production servers.
Download Specific Version
Section titled “Download Specific Version”Download a specific plugin version by its unique ID.
Endpoint: GET /api/plugin-versions/download/:id
Authentication: Not required (public endpoint)
URL Parameters
Section titled “URL Parameters”id(required) - Plugin version ID (e.g.,plugin-1234567890-abc123)
Example Request
Section titled “Example Request”curl -O -J "https://api.statsly.org/api/plugin-versions/download/plugin-1234567890-abc123"Response
Section titled “Response”Returns a JAR file download (same format as above).
Use specific version IDs for reproducible builds and to ensure you’re always using the same plugin version across multiple servers.
Server-Specific Endpoints
Section titled “Server-Specific Endpoints”For convenience, each server software has dedicated endpoints using lowercase names:
Normal Servers
Section titled “Normal Servers”GET /api/plugin-versions/download/latest/papermcGET /api/plugin-versions/download/latest/spigotGET /api/plugin-versions/download/latest/bukkitGET /api/plugin-versions/download/latest/purpurGET /api/plugin-versions/download/latest/quiltGET /api/plugin-versions/download/latest/leafmc
Folia Servers
Section titled “Folia Servers”GET /api/plugin-versions/download/latest/foliaGET /api/plugin-versions/download/latest/canvasmc
Proxy Servers
Section titled “Proxy Servers”GET /api/plugin-versions/download/latest/bungeecordGET /api/plugin-versions/download/latest/waterfallGET /api/plugin-versions/download/latest/velocity
Server software names are case-insensitive. Both PaperMC and papermc will work. The lowercase endpoints are provided for convenience and consistency.
Error Handling
Section titled “Error Handling”HTTP Status Codes
Section titled “HTTP Status Codes”200- Success (JAR file returned)404- Not Found (no version available for the specified criteria)429- Too Many Requests (rate limit exceeded)500- Internal Server Error
Error Response Format
Section titled “Error Response Format”{ "error": "No plugin version found for PaperMC"}Example Error Handling
Section titled “Example Error Handling”async function downloadPlugin(serverSoftware, javaVersion) { try { const url = `https://api.statsly.org/api/plugin-versions/download/latest/${serverSoftware}/${javaVersion}`; const response = await fetch(url);
if (!response.ok) { if (response.status === 404) { throw new Error('No plugin version found for your server software'); } throw new Error(`HTTP ${response.status}: ${response.statusText}`); }
const blob = await response.blob(); const filename = response.headers.get('Content-Disposition')?.split('filename=')[1]?.replace(/[""]/g, '') || 'Statsly.jar';
// Save file return { success: true, filename, blob }; } catch (error) { console.error('Download failed:', error); return { success: false, error: error.message }; }}Best Practices
Section titled “Best Practices”Download Optimization
Section titled “Download Optimization”- Use specific version IDs for reproducible builds
- Use latest endpoints for automatic updates
- Specify Java version for better compatibility
- Cache downloaded files locally
Automation
Section titled “Automation”- Implement retry logic with exponential backoff
- Check file integrity after download
- Verify file size matches expected size
- Handle network interruptions gracefully
For production servers, consider downloading specific versions by ID rather than always using “latest” to ensure stability and reproducibility.
Next Steps
Section titled “Next Steps”- Learn about Metadata Endpoints
- Check out Usage Examples
- Review Error Handling & Best Practices