Loading...
Loading...
Guide for integrating with the OpenJung (OEJTS) personality test API - a free, open-source alternative to MBTI. Use when building applications that need personality assessment, integrating MBTI-style tests, or working with the OpenJung API endpoints. Covers: (1) Fetching test questions, (2) Submitting answers and calculating results, (3) Understanding the scoring system, (4) Recording test sessions, (5) Retrieving aggregate statistics.
npx skill4agent add openmbti/core openjung-apihttps://openjung.org// 1. Fetch questions
const { questions } = await fetch('https://openjung.org/api/questions').then(r => r.json());
// 2. Collect user answers (32 questions, values 1-5)
const answers = { "1": 3, "2": 5, /* ... all 32 */ "32": 4 };
// 3. Calculate result
const { result } = await fetch('https://openjung.org/api/calculate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ answers })
}).then(r => r.json());
console.log(result.type); // "ENFP"GET /api/questions?locale=en{
"totalQuestions": 32,
"questions": [
{
"id": 1,
"dimension": "JP",
"leftTrait": "Makes lists",
"rightTrait": "Relies on memory"
}
]
}POST /api/calculate
{
"answers": { "1": 3, "2": 5, ... "32": 4 },
"locale": "en", // optional
"save": true // optional - saves to database
}{
"result": {
"type": "ENFP",
"scores": { "EI": 18, "SN": 28, "TF": 22, "JP": 32 },
"percentages": { "E": 75, "I": 25, "S": 12, "N": 88, "T": 31, "F": 69, "J": 0, "P": 100 },
"typeInfo": {
"name": "Campaigner",
"description": "...",
"strengths": ["..."],
"weaknesses": ["..."]
},
"shareUrl": "https://openjung.org/type/enfp?ei=18&sn=28&tf=22&jp=32"
},
"recordId": "uuid"
}POST /api/record
{
"answers": { ... },
"result": { "type": "ENFP", "scores": {...}, "percentages": {...} }
}{
"totalTests": 15234,
"typeDistribution": [{ "type": "INFP", "count": 2341 }],
"localeDistribution": [{ "locale": "en", "count": 8234 }]
}| Dimension | Question IDs |
|---|---|
| JP | 1, 5, 9, 13, 17, 21, 25, 29 |
| TF | 2, 6, 10, 14, 18, 22, 26, 30 |
| EI | 3, 7, 11, 15, 19, 23, 27, 31 |
| SN | 4, 8, 12, 16, 20, 24, 28, 32 |
localeenzhjakoesfrdept| Error Code | Description |
|---|---|
| Malformed JSON |
| Missing/wrong answers format |
| Not all 32 questions answered |
| Server error |