--- title: rd colorFrom: blue colorTo: green sdk: docker pinned: false --- ## 📱 API Integration (Mobile Apps) The API is deployed on Hugging Face Spaces. ### Request Format - **Method:** `POST` - **Body:** `multipart/form-data` - **Key:** `data` (file) ### Example Code (React Native/JS) ```javascript const API_URL = "https://prayag80-dr-api.hf.space/api/predict"; const formData = new FormData(); formData.append('data', { uri: imageUri, // Local file path type: 'image/jpeg', // Mime type name: 'retinal.jpg' // Filename }); try { const response = await fetch(API_URL, { method: 'POST', body: formData, headers: { 'Content-Type': 'multipart/form-data', }, }); const result = await response.json(); console.log(result); // Output: { data: [{ label: "No_DR", confidences: [...] }] } } catch (error) { console.error("API Error:", error); } ``` ## License MIT