tools Aktif Auth: api_key (header x-api-key)
/api/tools/devicecompare
Bandingkan dua spesifikasi ponsel dari Carisinyal. Gunakan query untuk GET atau objek JSON untuk POST.
Method & Parameter
Method didukung: GET, POST · Biaya kuota: 1 unit/request.
| Nama | Lokasi | Tipe | Wajib | Deskripsi |
|---|---|---|---|---|
| hp1 | query|body | string | Ya | Model atau ID perangkat pertama. Alias: q1, query1, phone1. |
| hp2 | query|body | string | Ya | Model atau ID perangkat kedua. Alias: q2, query2, phone2. |
Contoh Request (cURL)
curl -sS "https://api.sadiwa.site/api/tools/devicecompare?hp1=Samsung%20Galaxy%20A55&hp2=Redmi%20Note%2013" \
-H "x-api-key: YOUR_API_KEY" Contoh JavaScript / TypeScript (fetch)
const res = await fetch("https://api.sadiwa.site/api/tools/devicecompare?hp1=Samsung%20Galaxy%20A55&hp2=Redmi%20Note%2013", {
headers: { "x-api-key": "YOUR_API_KEY" },
});
const json = await res.json(); Contoh Respons Sukses
{
"creator": "Sadiwa API",
"result": {
"phone1": {
"id": "1",
"title": "Contoh A"
},
"phone2": {
"id": "2",
"title": "Contoh B"
},
"sections": []
},
"status": true
} Kode Error Standar
| HTTP | Arti | Solusi |
|---|---|---|
| 400 | Input tidak valid / kosong | Periksa parameter wajib. |
| 401 | API key tidak disertakan | Kirim header x-api-key. |
| 403 | API key tidak valid / dicabut / scope kurang | Periksa atau rotasi API key di dashboard. |
| 429 | Kuota harian atau rate limit tercapai | Tunggu reset UTC atau tingkatkan paket. |
| 502 | Sumber data eksternal tidak tersedia | Coba lagi setelah sumber pulih. |