Welcome to the MBTI Pep Talk API, an API that generates personalized pep talks based on MBTI types and moods. This API is designed to give you a quick boost of motivation or reassurance tailored to your personality type.
The MBTI Pep Talk API is a simple yet charming API that returns thoughtful, witty, and heartfelt pep talks for each of the 16 MBTI types. Not only does it customize advice for each MBTI type, but it also allows users to select a mood—because everyone needs different advice when they’re feeling sad, angry, frustrated, etc.
This is just the beginning! Future versions will include more emotions, customizable advice, and maybe even user-generated pep talks.
Here's how you can interact with the MBTI Pep Talk API.
Endpoint | Method | Description |
---|---|---|
/api/peptalk/ |
GET | Get pep talks with advanced filtering. Example: /api/peptalk?mbti_type=ISTJ&mood=angry&page=1&page_size=1 |
/api/peptalk/random |
GET | Get a random pep talk for the specified MBTI and mood. Example: /api/peptalk/random/?mbti_type=INTJ?mood=frustrated |
/api/peptalk/ |
POST | Add a pep talk. |
/api/peptalk/:id |
GET | Get a specific pep talk. Example: /api/peptalk/123/ |
/api/peptalk/:id |
DELETE | Delete a pep talk. Example: /api/peptalk/123/ |
/api/peptalk/:id |
PATCH | Partially edit a pep talk. Example: /api/peptalk/479/ |
/api/peptalk/:id |
PUT | Edit a pep talk. Example: /api/peptalk/321/ |
The following MBTI types are supported:
- Analysts: INTJ, INTP, ENTJ, ENTP
- Diplomats: INFJ, INFP, ENFJ, ENFP
- Sentinels: ISTJ, ISFJ, ESTJ, ESFJ
- Explorers: ISTP, ISFP, ESTP, ESFP
You can call the API from any HTTP client like Postman, Insomnia, or even from your browser’s URL bar. Here's a quick example:
Example Request:
GET /api/peptalk/INTJ?mood=sad
Example Response:
{
"type": "INTJ",
"mood": "sad",
"message": "감정이 흐려질 때는, 논리를 다시 확인하는 것이 가장 안전합니다."
}
- Node.js (v18+ recommended)
- npm (comes with Node.js)
git clone https://github.com/your-username/mbti-pep-talk-api.git
cd mbti-pep-talk-api
npm install
npm start
You’ll see:
Server is running on port 3000
The API will be available at: http://localhost:3000/
When you make a request to the API, it selects a random pep talk from a collection of personalized advice specific to your MBTI type. The mood (default, sad, or angry) determines which pool of advice is used to generate the response.
Example for INTJ (sad mood):
- "감정이 흐려질 때는, 논리를 다시 확인하는 것이 가장 안전합니다."
Example for ENFP (angry mood):
- "아니, 누가 우리 ENFP 화나게 했어? 나한테 말해봐."
Each type has its own unique flavor of pep talks. For logical types like INTJ, expect "Sheldon Cooper"-style brutal honesty. For emotional types like ENFP, expect more comforting words and "bestie energy."
Want to add your own pep talks or customize the API? You can! Here’s how:
- Open
server.js
- Locate the mbtiPepTalks object and add your pep talks under each MBTI type.
- Moods are categorized as
sad
,angry
,annoyed
,frustrated
,anxious
,depressed
,lonely
andoverwhelmed
.
This project is deployed on Netlify and runs as a serverless API. To deploy it yourself:
- Install the Netlify CLI:
npm install -g netlify-cli
- Link Your Project:
netlify link
- Deploy to Netlify:
netlify deploy --prod
Got ideas for new pep talks? Want to improve the design? We’d love your help! Here’s how you can contribute:
- Fork the repo and clone it locally.
- Create a new branch:
git checkout -b my-feature
- Commit your changes:
git commit -m 'Add some feature'
- Push to the branch:
git push origin my-feature
- Submit a pull request.
If you encounter any issues, please create a GitHub issue so we can track and resolve it.
This project is open-source and available under the MIT License.
Have questions or feedback? Feel free to reach out via email.
Enjoy your personalized pep talks! Stay fabulous! ✨