{"openapi":"3.0.0","info":{"title":"Rust Items API","version":"1.4.4","description":"API for Rust game items, crafting recipes, and item images","contact":{"name":"Rust Items Extractor","url":"https://github.com/nerif-tafu/rust-api"}},"servers":[{"url":"https://rust-api.tafu.casa","description":"Production server"},{"url":"http://localhost:3100","description":"Local development server"}],"components":{"schemas":{"Item":{"type":"object","properties":{"type":{"type":"string","example":"ItemDefinition"},"pathId":{"type":"string","example":"114761749039158340"},"shortname":{"type":"string","example":"ammo.grenadelauncher.buckshot"},"displayName":{"type":"string","example":"40mm Shotgun Round"},"itemid":{"type":"number","example":1055319033},"category":{"type":"number","example":8},"categoryName":{"type":"string","example":"Ammunition"},"stackable":{"type":"number","example":24},"volume":{"type":"number","example":0},"ingredients":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number","example":4},"itemDef":{"type":"object","properties":{"m_PathID":{"type":"string","example":"114643556312930600"},"shortname":{"type":"string","example":"metal.fragments"},"displayName":{"type":"string","example":"Metal Fragments"}}}}}},"craftTime":{"type":"number","example":0},"amountToCreate":{"type":"number","example":2},"workbenchLevelRequired":{"type":"number","example":3},"sourceFile":{"type":"string","example":"40mm_buckshot.item.prefab"}}}}},"paths":{"/":{"get":{"summary":"API root","description":"Welcome message and API information","responses":{"200":{"description":"API information","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"version":{"type":"string"},"endpoints":{"type":"array","items":{"type":"string"}}}}}}}}}},"/api/update-status":{"get":{"summary":"Check if game files need an update (Steam UpToDateCheck)","description":"Uses Steam UpToDateCheck API to determine if a force update is needed","responses":{"200":{"description":"Update status from Steam","content":{"application/json":{"schema":{"type":"object","properties":{"needUpdate":{"type":"boolean"},"upToDate":{"type":"boolean"},"currentVersion":{"type":"integer","nullable":true},"requiredVersion":{"type":"integer","nullable":true},"message":{"type":"string","nullable":true}}}}}}}}},"/api/force-update":{"post":{"summary":"Force game update and re-extraction","description":"Manually trigger a game update and re-extraction process","responses":{"200":{"description":"Update process started","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":true},"message":{"type":"string","example":"Update process started"}}}}}},"500":{"description":"Failed to start update","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean","example":false},"error":{"type":"string","example":"Update process failed"}}}}}}}}},"/api/logs":{"get":{"summary":"Get server console logs","description":"Retrieve recent server console logs for debugging and monitoring","parameters":[{"in":"query","name":"lines","schema":{"type":"integer","default":100},"description":"Number of recent log lines to return"}],"responses":{"200":{"description":"Server logs","content":{"application/json":{"schema":{"type":"object","properties":{"logs":{"type":"array","items":{"type":"string"}},"totalLines":{"type":"integer"},"timestamp":{"type":"string","format":"date-time"}}}}}},"500":{"description":"Failed to retrieve logs","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}},"/health":{"get":{"summary":"Get server health status","description":"Get detailed information about the server's health and readiness status","responses":{"200":{"description":"Server health information","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"integer","description":"Server readiness status (0-5)","example":5},"message":{"type":"string","description":"Human-readable status message","example":"Server ready - all services running and API available"},"details":{"type":"object","description":"Additional status details"},"uptime":{"type":"integer","description":"Server uptime in seconds","example":3600},"startTime":{"type":"string","format":"date-time","description":"When the server started"},"lastUpdate":{"type":"string","format":"date-time","description":"When the status was last updated"},"ready":{"type":"boolean","description":"Whether the server is ready to serve requests","example":true}}}}}}}}},"/ready":{"get":{"summary":"Check server readiness","description":"Simple endpoint to check if the server is ready to serve requests","responses":{"200":{"description":"Server is ready","content":{"application/json":{"schema":{"type":"object","properties":{"ready":{"type":"boolean","example":true},"status":{"type":"integer","example":5},"message":{"type":"string","example":"Server ready - all services running and API available"}}}}}},"503":{"description":"Server is not ready","content":{"application/json":{"schema":{"type":"object","properties":{"ready":{"type":"boolean","example":false},"status":{"type":"integer","example":3},"message":{"type":"string","example":"Downloading Rust game files - this may take a while"},"details":{"type":"object","description":"Additional status details"}}}}}}}}},"/api/items":{"get":{"summary":"Get all items","description":"Retrieve all Rust items with their crafting information","parameters":[{"in":"query","name":"limit","schema":{"type":"integer","default":50},"description":"Maximum number of items to return"},{"in":"query","name":"offset","schema":{"type":"integer","default":0},"description":"Number of items to skip"},{"in":"query","name":"category","schema":{"type":"integer"},"description":"Filter by item category"},{"in":"query","name":"hasCrafting","schema":{"type":"boolean"},"description":"Filter items that have crafting recipes"}],"responses":{"200":{"description":"List of items","content":{"application/json":{"schema":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Item"}},"total":{"type":"integer"},"limit":{"type":"integer"},"offset":{"type":"integer"}}}}}}}}},"/api/items/{shortname}":{"get":{"summary":"Get specific item","description":"Retrieve detailed information about a specific item","parameters":[{"in":"path","name":"shortname","required":true,"schema":{"type":"string"},"description":"Item shortname (e.g., 'pistol.eoka')"}],"responses":{"200":{"description":"Item details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Item"}}}},"404":{"description":"Item not found"}}}},"/api/categories":{"get":{"summary":"Get all categories","description":"Retrieve all available item categories with their IDs and names","responses":{"200":{"description":"List of categories","content":{"application/json":{"schema":{"type":"object","properties":{"categories":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number"},"name":{"type":"string"},"count":{"type":"number"}}}}}}}}}}}},"/api/items/{shortname}/image":{"get":{"summary":"Get item image","description":"Redirect to the item's image file","parameters":[{"in":"path","name":"shortname","required":true,"schema":{"type":"string"},"description":"Item shortname (e.g., 'pistol.eoka')"}],"responses":{"302":{"description":"Redirect to image"},"404":{"description":"Image not found"}}}},"/api/version":{"get":{"summary":"Get game file version information","description":"Retrieve information about the currently downloaded Rust game files version","responses":{"200":{"description":"Game version information","content":{"application/json":{"schema":{"type":"object","properties":{"buildId":{"type":"string","description":"Steam build ID of the downloaded game files","example":"12345678"},"hasGameFiles":{"type":"boolean","description":"Whether game files are currently downloaded","example":true},"versionFileExists":{"type":"boolean","description":"Whether version information is available","example":true},"lastUpdated":{"type":"string","format":"date-time","description":"When the version file was last modified","example":"2024-01-15T10:30:00.000Z"},"gameDataPath":{"type":"string","description":"Path to the game data directory","example":"/opt/rust-api/game-data"}}}}}},"404":{"description":"No game files or version information found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"No game files found"},"hasGameFiles":{"type":"boolean","example":false}}}}}}}}},"/api/crafting":{"get":{"summary":"Get crafting items","description":"Retrieve all items that have crafting recipes","parameters":[{"in":"query","name":"limit","schema":{"type":"integer","default":50},"description":"Maximum number of items to return"},{"in":"query","name":"offset","schema":{"type":"integer","default":0},"description":"Number of items to skip"}],"responses":{"200":{"description":"Items with crafting recipes","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/api/images/download-all":{"get":{"summary":"Download all item images","description":"Download all available item images as a ZIP file","responses":{"200":{"description":"ZIP file containing all item images","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"500":{"description":"Error creating ZIP file"}}}},"/api/images/cache-status":{"get":{"summary":"Get ZIP cache status","description":"Get information about the cached ZIP file","responses":{"200":{"description":"Cache status information","content":{"application/json":{"schema":{"type":"object"}}}}}}}},"tags":[]}