API Exempel
1. Hämta alla ämnen
fetch('gy25.php?api')
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
2. Hämta ämnesinformation
const subjectCode = 'AKTI';
fetch(`gy25.php?code=${subjectCode}`)
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
1. Hämta alla ämnen
$ch = curl_init('gy25.php?api');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);

print_r($data);
2. Hämta ämnesinformation
$subjectCode = 'AKTI';
$ch = curl_init('gy25.php?code=' . urlencode($subjectCode));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);

print_r($data);
API Dokumentation
Tillgängliga endpoints
Endpoint Metod Beskrivning Exempel Svarsdata
/gy25.php?api GET Hämta alla ämnen /gy25.php?api
/gy25.php?code=AKTI GET Hämta ämnesinformation /gy25.php?code=AKTI