NextSchoolNextSchool Data API

Query EQ

Fetch the scored EQ result for a student across all 9 sub-dimensions

Query EQ for One Student

Returns the 9 EQ sub-dimensions grouped into ดี / เก่ง / สุข, the total score, and the raw answers. EQ is student-only.

curl -X POST https://data.nextschool.io/ \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -d '{
    "query": "{ student(id: 12345) { id fullName eq { totalScore totalAnswered dimensions { name nameText group groupText score level levelText } } } }"
  }'
const response = await fetch('https://data.nextschool.io/', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${accessToken}`
  },
  body: JSON.stringify({
    query: `{
      student(id: 12345) {
        id
        fullName
        eq {
          totalScore
          totalAnswered
          dimensions {
            name
            nameText
            group
            groupText
            score
            level
            levelText
          }
        }
      }
    }`
  })
});
const { data } = await response.json();
console.log(data.student.eq);
response = requests.post('https://data.nextschool.io/',
    headers={
        'Content-Type': 'application/json',
        'Authorization': f'Bearer {access_token}'
    },
    json={
        'query': '''{
            student(id: 12345) {
                id
                fullName
                eq {
                    totalScore
                    totalAnswered
                    dimensions {
                        name
                        nameText
                        group
                        groupText
                        score
                        level
                        levelText
                    }
                }
            }
        }'''
    }
)
eq = response.json()['data']['student']['eq']
<?php
$ch = curl_init('https://data.nextschool.io/');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
        "Authorization: Bearer $accessToken"
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'query' => '{ student(id: 12345) { id fullName eq { totalScore totalAnswered dimensions { name nameText group groupText score level levelText } } } }'
    ]),
    CURLOPT_RETURNTRANSFER => true,
]);
$result = json_decode(curl_exec($ch), true);
$eq = $result['data']['student']['eq'];
body, _ := json.Marshal(map[string]string{
    "query": `{ student(id: 12345) { id fullName eq { totalScore totalAnswered dimensions { name nameText group groupText score level levelText } } } }`,
})
req, _ := http.NewRequest("POST", "https://data.nextschool.io/", bytes.NewBuffer(body))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+accessToken)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()

var result map[string]any
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result["data"])
let resp = client.post("https://data.nextschool.io/")
    .header("Content-Type", "application/json")
    .header("Authorization", format!("Bearer {}", access_token))
    .json(&serde_json::json!({
        "query": "{ student(id: 12345) { id fullName eq { totalScore totalAnswered dimensions { name nameText group groupText score level levelText } } } }"
    }))
    .send().await?
    .json::<serde_json::Value>().await?;

println!("{:#}", resp["data"]["student"]["eq"]);

Query EQ Student List

List students in a classroom with their EQ completion count.

curl -X POST https://data.nextschool.io/ \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -d '{
    "query": "{ eqStudents(classroomId: 42, status: \"progress\", limit: 20) { studentId code firstname lastname classroomName answered done } }"
  }'
const response = await fetch('https://data.nextschool.io/', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': `Bearer ${accessToken}`
  },
  body: JSON.stringify({
    query: `{
      eqStudents(classroomId: 42, status: "progress", limit: 20) {
        studentId
        code
        firstname
        lastname
        classroomName
        answered
        done
      }
    }`
  })
});
const { data } = await response.json();
console.log(data.eqStudents);
response = requests.post('https://data.nextschool.io/',
    headers={
        'Content-Type': 'application/json',
        'Authorization': f'Bearer {access_token}'
    },
    json={
        'query': '''{
            eqStudents(classroomId: 42, status: "progress", limit: 20) {
                studentId
                code
                firstname
                lastname
                classroomName
                answered
                done
            }
        }'''
    }
)
students = response.json()['data']['eqStudents']
<?php
$ch = curl_init('https://data.nextschool.io/');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        'Content-Type: application/json',
        "Authorization: Bearer $accessToken"
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'query' => '{ eqStudents(classroomId: 42, status: "progress", limit: 20) { studentId code firstname lastname classroomName answered done } }'
    ]),
    CURLOPT_RETURNTRANSFER => true,
]);
$result = json_decode(curl_exec($ch), true);
$students = $result['data']['eqStudents'];
body, _ := json.Marshal(map[string]string{
    "query": `{ eqStudents(classroomId: 42, status: "progress", limit: 20) { studentId code firstname lastname classroomName answered done } }`,
})
req, _ := http.NewRequest("POST", "https://data.nextschool.io/", bytes.NewBuffer(body))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer "+accessToken)
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()

var result map[string]any
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result["data"])
let resp = client.post("https://data.nextschool.io/")
    .header("Content-Type", "application/json")
    .header("Authorization", format!("Bearer {}", access_token))
    .json(&serde_json::json!({
        "query": "{ eqStudents(classroomId: 42, status: \"progress\", limit: 20) { studentId code firstname lastname classroomName answered done } }"
    }))
    .send().await?
    .json::<serde_json::Value>().await?;

println!("{:#}", resp["data"]["eqStudents"]);

On this page