Authentication
Learn how to use an API key to authenticate and access all endpoints of the JKT48Connect REST API.
API Authentication
All endpoints of the JKT48Connect API require authentication using an API key. The API key is sent as a query parameter in every request.
Authentication Format
Append the apikey parameter to your request URL:
https://v2.jkt48connect.com/api/jkt48/{endpoint}?apikey=YOUR_API_KEYExamples with Authentication
# Fetching member data
curl "https://v2.jkt48connect.com/api/jkt48/members?apikey=YOUR_API_KEY"
# Fetching live streaming data
curl "https://v2.jkt48connect.com/api/jkt48/live?apikey=YOUR_API_KEY"
# Fetching the theater schedule
curl "https://v2.jkt48connect.com/api/jkt48/theater?apikey=YOUR_API_KEY"JavaScript Example
const API_KEY = 'YOUR_API_KEY';
const BASE_URL = 'https://v2.jkt48connect.com';
async function fetchMembers() {
const response = await fetch(`${BASE_URL}/api/jkt48/members?apikey=${API_KEY}`);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
console.log(data);
return data;
}
fetchMembers();Python Example
import requests
API_KEY = 'YOUR_API_KEY'
BASE_URL = 'https://v2.jkt48connect.com'
def fetch_members():
response = requests.get(f"{BASE_URL}/api/jkt48/members?apikey={API_KEY}")
response.raise_for_status()
data = response.json()
print(data)
return data
fetch_members()Invalid API Key Response
If the provided API key is invalid or missing, the API will return an error:
{
"status": false,
"message": "Invalid API Key"
}HTTP Status Code: 403 Forbidden
Obtaining an API Key
To get an API key:
- Visit jkt48connect.my.id/buyapi
- Choose an appropriate package
- Complete the payment process
- Your API key will be delivered to you
Security Tips
- Do not hardcode your API key in public repositories (like GitHub)
- Use environment variables to securely store your API key
- Do not share your API key with anyone
- If your API key is compromised, contact support immediately for a replacement
# Using environment variables in bash
export JKT48_API_KEY="your_actual_api_key_here"// Accessing via environment variables in Node.js
const API_KEY = process.env.JKT48_API_KEY;# Accessing via environment variables in Python
import os
API_KEY = os.environ.get('JKT48_API_KEY')