@extends('layouts.public')
@section('title', 'Dokumentasi API — Daisy Risk Global Supply Chain Intelligence')
@push('styles')
@endpush
@section('content')
{{-- Hero Section --}}
RESTful API yang powerful untuk mengintegrasikan data supply chain intelligence ke dalam sistem Anda. Simple, fast, dan reliable.
Dokumentasi API
Semua API requests memerlukan API key yang valid. Include API key di header request atau sebagai query parameter.
Header Authentication (Recommended):
curl -H "X-API-Key: your_api_key_here" \
https://api.daisyrisk.com/v1/countries
Query Parameter:
https://api.daisyrisk.com/v1/countries?api_key=your_api_key_here
Rate limits diterapkan per API key untuk memastikan fair usage dan performance optimal.
Rate limit headers included dalam setiap response: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset
Retrieve risk scores untuk semua negara dengan breakdown detail per kategori risiko.
{{-- Parameters --}}| Parameter | Type | Required | Description |
|---|---|---|---|
| limit | integer | No | Number of results (default: 50, max: 200) |
| offset | integer | No | Pagination offset (default: 0) |
| sort | string | No | Sort field: risk_score, country_name (default: risk_score) |
| order | string | No | Sort order: asc, desc (default: desc) |
curl -H "X-API-Key: your_api_key" \
"https://api.daisyrisk.com/v1/risk-scores?limit=10&sort=risk_score&order=desc"
{
"status": "success",
"data": [
{
"country_code": "ID",
"country_name": "Indonesia",
"risk_score": 67.5,
"risk_level": "Medium",
"breakdown": {
"weather_score": 23.5,
"economy_score": 18.2,
"inflation_score": 12.8,
"currency_score": 8.7,
"port_score": 4.3
},
"last_updated": "2026-07-21T09:30:00Z"
}
],
"pagination": {
"total": 195,
"limit": 10,
"offset": 0,
"has_more": true
}
}
Retrieve detailed risk analysis untuk negara tertentu dengan historical data.
{{-- Path Parameters --}}| Parameter | Type | Required | Description |
|---|---|---|---|
| country_code | string | Yes | ISO 3166-1 alpha-2 country code (e.g., ID, US, CN) |
curl -H "X-API-Key: your_api_key" \
"https://api.daisyrisk.com/v1/risk-scores/ID"
Retrieve basic information untuk semua negara termasuk koordinat geografis dan metadata.
// JavaScript Example
const response = await fetch('https://api.daisyrisk.com/v1/countries', {
headers: {
'X-API-Key': 'your_api_key_here'
}
});
const data = await response.json();
console.log(data.data); // Array of countries
Current weather conditions dan forecast untuk negara tertentu dengan severe weather alerts.
# Python Example
import requests
headers = {'X-API-Key': 'your_api_key'}
response = requests.get(
'https://api.daisyrisk.com/v1/weather/ID',
headers=headers
)
weather_data = response.json()
print(f"Temperature: {weather_data['data']['temperature']}°C")
Real-time port status, congestion levels, dan operational information untuk major ports worldwide.
| Parameter | Type | Description |
|---|---|---|
| country | string | Filter by country code |
| status | string | Filter by status: operational, congested, closed |
API menggunakan standard HTTP status codes dan error format yang konsisten.
Request successful
Invalid request parameters
Invalid or missing API key
Rate limit exceeded
{
"status": "error",
"error": {
"code": 401,
"message": "Invalid API key",
"details": "The provided API key is not valid or has expired"
},
"timestamp": "2026-07-21T09:30:00Z"
}
Dapatkan API key gratis dan mulai integrasikan supply chain intelligence ke aplikasi Anda.