API untuk mendeteksi berita palsu dan memberikan informasi akurat
API ini memungkinkan pengguna untuk melakukan pendaftaran, login, logout, serta verifikasi apakah berita yang diberikan adalah hoaks atau tidak. Pengguna dapat mengakses berita hoaks terbaru dan melakukan prediksi melalui artikel berita menggunakan URL atau teks.
Domain API: https://api-cc-hofe.vercel.app/
POST /api/user/register
{ "username": "your_username", "email": "your_email@example.com", "password": "your_password" }
{ "statusCode": 201, "message": "User created successfully." }
curl -X POST https://api-cc-hofe.vercel.app/api/user/register \ -H "Content-Type: application/json" \ -d '{"username": "your_username", "email": "your_email@example.com", "password": "your_password"}'
POST /api/user/login
{ "username": "your_username", "password": "your_password" }
{ "statusCode": 200, "message": "Login successful.", "access_token": "your_access_token" }
curl -X POST https://api-cc-hofe.vercel.app/api/user/login \ -H "Content-Type: application/json" \ -d '{"username": "your_username", "password": "your_password"}'
GET /api/news
{ "Authorization": "Bearer" }
[ { "title": "SMP Student Kills Friend in Violent Attack", "link": "https://turnbackhoax.id/2024/11/24/salah-siswa-smp-aniaya-teman-hingga-tewas/", "date": "November 24, 2024", "image": "https://turnbackhoax.id/wp-content/uploads/2024/11/WhatsApp-Image-2024-11-24-at-17.43.57-326x245.jpeg", "content": "In reality, the victim is still alive and just unconscious during the incident.", "category": "Hoax" }, ... ]
curl -X GET https://api-cc-hofe.vercel.app/api/news -H "Authorization: Bearer"
POST /api/news/predict/text
{ "text": "Example news text that needs to be validated" }
{ "statusCode": 200, "prediction": "Valid", // or "Invalid" for hoax news "text": "Example news text" }
curl -X POST https://api-cc-hofe.vercel.app/api/news/predict/text \ -H "Authorization: Bearer" \ -H "Content-Type: application/json" \ -d '{"text": "Example news text"}'
POST /api/news/predict/url
{ "url": "string" // URL of the news to be predicted }
{ "statusCode": 200, "prediction": "Valid", // or "Invalid" for hoax news "text": "example news text" }
curl -X POST https://api-cc-hofe.vercel.app/api/news/predict/url \ -H "Authorization: Bearer" \ -H "Content-Type: application/json" \ -d '{"url": "news-url"}'
GET /api/user/profile
{ "username": "your_username", "email": "your_email@example.com" }
curl -X GET https://api-cc-hofe.vercel.app/api/user/profile -H "Authorization: Bearer"