@extends('layouts.public') @section('title', 'Dokumentasi API — Daisy Risk Global Supply Chain Intelligence') @push('styles') @endpush @section('content') {{-- Hero Section --}}
⚡

Dokumentasi API

RESTful API yang powerful untuk mengintegrasikan data supply chain intelligence ke dalam sistem Anda. Simple, fast, dan reliable.

🚀 REST API v1.0
⏱️ 1000 requests/hour
{{-- Sidebar Navigation --}}
{{-- Main Content --}}
{{-- Authentication --}}

🔐 Authentication

API Key Authentication

Semua API requests memerlukan API key yang valid. Include API key di header request atau sebagai query parameter.

Header Authentication (Recommended):

curl
curl -H "X-API-Key: your_api_key_here" \ https://api.daisyrisk.com/v1/countries

Query Parameter:

url
https://api.daisyrisk.com/v1/countries?api_key=your_api_key_here
{{-- Rate Limits --}}

⏱️ Rate Limits

Rate limits diterapkan per API key untuk memastikan fair usage dan performance optimal.

1,000
Requests per hour
50
Requests per minute
10
Concurrent requests

Rate limit headers included dalam setiap response: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset

{{-- Risk Scores API --}}

📊 Risk Scores API

{{-- Get All Risk Scores --}}
GET
/api/v1/risk-scores
Get all country risk scores

Retrieve risk scores untuk semua negara dengan breakdown detail per kategori risiko.

{{-- Parameters --}}

Query 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)
{{-- Example Request --}}

Example Request

curl
curl -H "X-API-Key: your_api_key" \ "https://api.daisyrisk.com/v1/risk-scores?limit=10&sort=risk_score&order=desc"
{{-- Example Response --}}

Example Response

200 OK
json
{ "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 } }
{{-- Get Single Country Risk --}}
GET
/api/v1/risk-scores/{country_code}
Get specific country risk score

Retrieve detailed risk analysis untuk negara tertentu dengan historical data.

{{-- Path Parameters --}}

Path Parameters

Parameter Type Required Description
country_code string Yes ISO 3166-1 alpha-2 country code (e.g., ID, US, CN)

Example Request

curl
curl -H "X-API-Key: your_api_key" \ "https://api.daisyrisk.com/v1/risk-scores/ID"
{{-- Countries API --}}

🌍 Countries API

GET
/api/v1/countries
Get all countries data

Retrieve basic information untuk semua negara termasuk koordinat geografis dan metadata.

javascript
// 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
{{-- Weather API --}}

🌤️ Weather API

GET
/api/v1/weather/{country_code}
Get weather data for country

Current weather conditions dan forecast untuk negara tertentu dengan severe weather alerts.

python
# 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")
{{-- Ports API --}}

⚓ Ports API

GET
/api/v1/ports
Get ports data with status

Real-time port status, congestion levels, dan operational information untuk major ports worldwide.

Query Parameters

Parameter Type Description
country string Filter by country code
status string Filter by status: operational, congested, closed
{{-- Error Handling --}}

❌ Error Handling

API menggunakan standard HTTP status codes dan error format yang konsisten.

200 OK

Request successful

400 Bad Request

Invalid request parameters

401 Unauthorized

Invalid or missing API key

429 Too Many Requests

Rate limit exceeded

Error Response Format

json
{ "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" }
{{-- CTA Section --}}

Siap Mengintegrasikan API?

Dapatkan API key gratis dan mulai integrasikan supply chain intelligence ke aplikasi Anda.

@endsection {{-- Include Footer --}} @section('footer') @include('partials.footer') @endsection @push('scripts') @endpush