Hier ist die vollständige API-Dokumentation — klar strukturiert, inkl. Beispielcode für PHP, JSON-Antworten und Parametererklärungen 🚀
🧭 Star Citizen Ship API – Developer Reference
Base URL:
https://starcitizen-association.com/wp-json/sc/v1/
🚢 1. GET /ships
Beschreibung:
Listet alle Schiffe auf, die im System gespeichert sind.
Dies ist der Hauptendpunkt für Flottenübersichten, Listen oder Imports.
Beispiel:
https://starcitizen-association.com/wp-json/sc/v1/ships
Optionale Parameter:
| Parameter | Typ | Beschreibung |
|---|---|---|
search | string | Suchbegriff (durchsucht Name, Hersteller, Rolle etc.) |
Beispiel mit Suche:
https://starcitizen-association.com/wp-json/sc/v1/ships?search=Aurora
🧾 Beispiel-Antwort:
[
{
"id": 120,
"name": "Aurora ES",
"link": "https://starcitizen-association.com/ship/aurora-es/",
"image_url": "https://starcitizen-association.com/wp-content/uploads/aurora.jpg",
"manufacturer": "RSI",
"role": "Starter / Pathfinder",
"size": "Small",
"length": "18.0",
"width": "8.0",
"height": "5.0",
"crew": "1",
"crew_max": "1",
"cargo_capacity": "3",
"power_plant": "Small",
"shield_generator": "Grade 3",
"release_state": "Flight Ready"
},
...
]
🛠 2. GET /ships/{id}
Beschreibung:
Gibt die vollen Details eines einzelnen Schiffs aus.
Beispiel:
https://starcitizen-association.com/wp-json/sc/v1/ships/120
Antwort:
{
"id": 120,
"name": "Aurora ES",
"link": "https://starcitizen-association.com/ship/aurora-es/",
"image_url": "https://starcitizen-association.com/wp-content/uploads/aurora.jpg",
"manufacturer": "RSI",
"role": "Starter / Pathfinder",
"size": "Small",
"length": "18",
"width": "8",
"height": "5",
"crew": "1",
"cargo_capacity": "3",
"power_plant": "Small",
"shield_generator": "Grade 3",
"cooler": "Civilian Grade A",
"jump_drive": "Medium",
"quantum_drive": "C1",
"missiles": "2x Size 1",
"release_state": "Flight Ready"
}
⚙️ 3. API-Felder (Properties)
Alle Daten stammen aus den Schiffs-Metadaten (_sc_ship_specs) und werden dynamisch ausgegeben.
Folgende Felder sind aktuell verfügbar:
| Feld | Beschreibung | Beispiel |
|---|---|---|
id | Datenbank-ID des Schiffs | 120 |
name | Name des Schiffs | Aurora ES |
manufacturer | Hersteller | RSI |
role | Primäre Rolle | Starter / Pathfinder |
size | Schiffsgröße | Small |
length, width, height | Maße in Metern | 18.0 |
crew, crew_max | Min/Max Crew | 1, 3 |
cargo_capacity | Frachtvolumen (SCU) | 3 |
power_plant, shield_generator, cooler, radar, computer, life_support | Systemkomponenten | Grade C |
engines, thrusters, jump_drive, quantum_drive | Antriebssysteme | Small, C1 |
guns, turrets, missiles, utility_mounts | Waffen & Ausstattung | 2x S1 |
armory, medical_bed, docking_ports | Ausstattung / Module | Basic, 1x Medium |
insurance_expiry | Dauer der Versicherung | 120 Monate |
release_state | Produktionsstatus | Flight Ready, In Concept, Hangar Ready |
🧩 Beispiel: PHP-Code für Entwickler
<?php
$api_url = "https://starcitizen-association.com/wp-json/sc/v1/ships";
$json = file_get_contents($api_url);
$ships = json_decode($json, true);
if (is_array($ships)) {
foreach ($ships as $ship) {
echo "<h3>{$ship['name']}</h3>";
echo "<p><strong>Hersteller:</strong> {$ship['manufacturer']}</p>";
echo "<p><strong>Rolle:</strong> {$ship['role']}</p>";
echo "<p><strong>Größe:</strong> {$ship['size']}</p>";
echo "<hr>";
}
} else {
echo "Fehler beim Laden der API.";
}
?>
🧠 Hinweise für externe Entwickler
- API ist read-only – kein Login oder Token erforderlich
- Ergebnisse werden als UTF-8 JSON geliefert
- Zugriff erlaubt über:
- PHP (
file_get_contents,cURL) - JavaScript (
fetch()) - Python (
requests) - C# (
HttpClient)
- PHP (
- Für Performance: bitte lokal cachen (z. B. 1× täglich)
- Keine Rate Limits (Stand jetzt), bitte aber < 1 Request / Minute bei automatischen Abrufen
🚀 Beispiel: Schnelltest via Browser
Alle Schiffe:
https://starcitizen-association.com/wp-json/sc/v1/ships
Nur ein Schiff:
https://starcitizen-association.com/wp-json/sc/v1/ships/120
Suchanfrage:
https://starcitizen-association.com/wp-json/sc/v1/ships?search=Cutlass