JSON Response Format
An in-depth guide on how to process the structured JSON returned by the JKT48Connect API.
JSON Response Format
Every interaction with a JKT48Connect API endpoint will return a data representation formatted in JSON (JavaScript Object Notation). This consistent format simplifies parsing and data validation within your application.
General "Success" Structure
For valid and successfully executed requests, the API will return an HTTP status code of 200 OK.
The returned JSON payload is typically structured as an Array of Objects:
[
{
"key1": "value1",
"key2": "value2"
},
{
"key1": "value3",
"key2": "value4"
}
]Depending on the underlying data reference from official sources / IDN / Showroom, some fields might be empty strings (""), null, or omitted if deemed irrelevant. Always implement null-checks when parsing the JSON.
Empty Array Variations
If the provided parameters are correct, but the system doesn't find a set of results (for instance, there are no members currently broadcasting live), the API will return an empty array rather than dispatching an error code:
[]Example in JavaScript:
const liveData = await response.json();
if (!liveData.length) {
console.log("There are no JKT48 members currently live at the moment.");
}General "Error" Structure
If a client-side error occurs (such as a missing apikey parameter, or exceeding rate limits) or an internal server error happens, the returned response will typically be a single Object containing status and message fields. The API will NOT return an Array, and the HTTP Headers will reflect a non-200 OK status.
{
"status": false,
"message": "Invalid API Key"
}Example of common client-side error-handling implementation:
fetch("https://v2.jkt48connect.com/api/jkt48/members?apikey=WRONGKEY")
.then(response => {
if (!response.ok) {
return response.json().then(err => { throw new Error(err.message) });
}
return response.json();
})
.catch(error => {
console.error("Failed to retrieve JKT48 data:", error.message);
});Datetime Formatting
Date and time values are generally formatted as YYYY-MM-DD or use the ISO 8601 UTC Time standard.
The started_at data from the Live Streaming list utilizes the ISO 8601 format ("2025-04-06T12:03:58.000Z"), where the trailing 'Z' denotes the UTC timezone (Zero offset). You will need to adjust this to Jakarta local time (WIB, UTC+7) or your users' local timezone during rendering/formatting.
Converting to Local Time via Javascript:
const serverDate = new Date("2025-04-06T12:03:58.000Z");
// JavaScript automatically converts this to the user's device locale timezone
console.log(serverDate.toLocaleString());