API Documentation
Integrate the MBTI personality test into your applications
Base URL
https://openmbti.org/api Privacy
No private information is stored. The API does not collect IP addresses, cookies, user agents, or any personally identifiable information. Only session ID, answers, and results are stored.
POST /api/calculate (Recommended)
Submit all 32 answers at once and get the result immediately. This is the simplest way to use the API.
Request
POST /api/calculate
Content-Type: application/json
{
"answers": {
"1": 3, "2": 4, "3": 2, "4": 5, "5": 3, "6": 4, "7": 2, "8": 5,
"9": 3, "10": 4, "11": 2, "12": 5, "13": 3, "14": 4, "15": 2, "16": 5,
"17": 3, "18": 4, "19": 2, "20": 5, "21": 3, "22": 4, "23": 2, "24": 5,
"25": 3, "26": 4, "27": 2, "28": 5, "29": 3, "30": 4, "31": 2, "32": 5
},
"locale": "en",
"save": false
} Parameters
answers(required): Object mapping question IDs (1-32) to answers (1-5)locale(optional):en,zh,ja,ko, orzh-twsave(optional): Whether to save the result to database (default:false)
Response
{
"result": {
"type": "ENFP",
"scores": { "EI": 18, "SN": 30, "TF": 16, "JP": 32 },
"percentages": {
"E": 69, "I": 31, "S": 31, "N": 69,
"F": 75, "T": 25, "J": 25, "P": 75
},
"typeInfo": {
"name": "Campaigner",
"nickname": "The Champion",
"description": "ENFPs are enthusiastic, creative...",
"strengths": ["Curious", "Observant", "Energetic"],
"weaknesses": ["Poor practical skills", "Difficult to focus"],
"compatibleTypes": ["INTJ", "INFJ"],
"famousExamples": ["Robin Williams", "Robert Downey Jr."]
},
"shareUrl": "https://openmbti.org/en/result/ENFP-18-30-16-32"
},
"recordId": "550e8400-..." // Only when save=true
} GET /api/questions
Get all 32 test questions. Useful for displaying questions to users before collecting answers.
Query Parameters
locale(optional):en(default) orzh
Response
{
"totalQuestions": 32,
"questions": [
{
"id": 1,
"dimension": "JP",
"leftTrait": "Makes lists",
"rightTrait": "Relies on memory"
},
...
]
} Scoring System
- Each dimension has 8 questions (32 total)
- Answers range from 1-5
- Raw scores per dimension: 8-40
- Score > 24 determines the dominant trait
Answer Scale
1= Strongly agree with left trait2= Somewhat agree with left trait3= Neutral4= Somewhat agree with right trait5= Strongly agree with right trait
Dimensions
| Dimension | Left Trait (1-2) | Right Trait (4-5) |
|---|---|---|
| EI | Extroversion (E) | Introversion (I) |
| SN | Sensing (S) | Intuition (N) |
| TF | Feeling (F) | Thinking (T) |
| JP | Judging (J) | Perceiving (P) |
Quick Example
curl -X POST https://openmbti.org/api/calculate \
-H "Content-Type: application/json" \
-d '{
"answers": {
"1": 3, "2": 4, "3": 2, "4": 5, "5": 3, "6": 4, "7": 2, "8": 5,
"9": 3, "10": 4, "11": 2, "12": 5, "13": 3, "14": 4, "15": 2, "16": 5,
"17": 3, "18": 4, "19": 2, "20": 5, "21": 3, "22": 4, "23": 2, "24": 5,
"25": 3, "26": 4, "27": 2, "28": 5, "29": 3, "30": 4, "31": 2, "32": 5
},
"locale": "en"
}' Error Responses
{
"error": "Error message",
"code": "ERROR_CODE",
"details": "Optional additional details"
} INVALID_PARAMS(400): Invalid question ID or answer valueINCOMPLETE_ANSWERS(400): Not all 32 questions answeredINVALID_BODY(400): Invalid JSON body
CORS & Rate Limiting
All endpoints support CORS and can be called from any origin.
Currently no rate limiting is enforced, but please be respectful with API usage.
MCP Server (for AI Agents)
The MBTI test is also available as a remote MCP server for AI agents like Claude, Cursor, and other MCP-compatible clients.
https://mcp.openmbti.org/sse See the GitHub repository for MCP setup instructions.