atau

Preview muncul setelah URL valid. Format URL mengikuti whitelist yang sama dengan upload file.

Mengirim gambar ke API klasifikasi...

Hasil klasifikasi akan tampil setelah gambar diupload.

Detail lima kelas prediksi akan muncul di sini.

Consume API

Dokumentasi Penggunaan API

Kirim binary gambar langsung ke endpoint klasifikasi menggunakan metode POST dan header Content-Type: application/octet-stream. Response JSON berisi array prediction.

POST https://nsfw.mitecorp.web.id/classify

Node.js / Browser

const res = await fetch("https://nsfw.mitecorp.web.id/classify", {
  method: "POST",
  headers: { "Content-Type": "application/octet-stream" },
  body: imageBlobOrBuffer,
});
const { prediction } = await res.json();

Python

import requests

with open("image.jpg", "rb") as f:
    resp = requests.post(
        "https://nsfw.mitecorp.web.id/classify",
        data=f,
        headers={"Content-Type": "application/octet-stream"},
    )
print(resp.json()["prediction"])
# [{ className: "Neutral", probability: 0.637 }, ...]

httpie

http POST https://nsfw.mitecorp.web.id/classify \
  Content-Type:application/octet-stream \
  @image.jpg

curl

curl -X POST \
  -H "Content-Type: application/octet-stream" \
  --data-binary @image.jpg \
  https://nsfw.mitecorp.web.id/classify