Quick Start
Get started with Japan Data API in minutes.
Base URL
https://api.japandata.io/v1Authentication
All API requests require authentication via an API key. Include your key in the Authorization header:
Authorization: Bearer YOUR_API_KEYAPI Endpoints
Explore all available endpoints.
Code Examples
Examples in popular programming languages.
curl -X GET "https://api.japandata.io/v1/prefectures" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"Response Format
All responses follow a consistent JSON structure:
{
"success": true,
"data": [
{
"id": 1,
"name": "Hokkaido",
"name_ja": "北海道",
"name_en": "Hokkaido",
"slug": "hokkaido",
"iso_code": "JP-01",
"region_id": 1,
"capital": "Sapporo",
"area_km2": 83424,
"population": 5224614
},
{
"id": 2,
"name": "Aomori",
"name_ja": "青森県",
"name_en": "Aomori",
"slug": "aomori",
"iso_code": "JP-02",
"region_id": 2,
"capital": "Aomori",
"area_km2": 9645,
"population": 1237984
}
],
"meta": {
"page": 1,
"limit": 50,
"total": 47
},
"error": null
}Error Handling
When an error occurs, the API returns a structured error response:
{
"success": false,
"data": null,
"meta": {},
"error": {
"code": "RATE_LIMIT_EXCEEDED",
"message": "You have exceeded your rate limit. Please try again later."
}
}Common Error Codes
| Code | HTTP Status | Description |
|---|---|---|
| UNAUTHORIZED | 401 | Missing or invalid API key |
| NOT_FOUND | 404 | Resource not found |
| RATE_LIMIT_EXCEEDED | 429 | Too many requests |
| SERVER_ERROR | 500 | Internal server error |