Documentation

Learn how to integrate Japan Data API

Quick Start

Get started with Japan Data API in minutes.

1
Create an Account

Sign up for a free account to get your API key. No credit card required.

Sign up free →
2
Get Your API Key

Generate an API key from your dashboard. Keep it secret and secure.

3
Make Your First Request

Use your API key to authenticate requests and start fetching data.

Base URL

https://api.japandata.io/v1

Authentication

All API requests require authentication via an API key. Include your key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

API Endpoints

Explore all available endpoints.

Regions
GET
/regions

List all regions

GET
/regions/{id}

Get a specific region

Prefectures
GET
/prefectures

List all prefectures

GET
/prefectures/{id}

Get a specific prefecture

GET
/regions/{id}/prefectures

List prefectures in a region

Cities
GET
/cities

List all cities (paginated)

GET
/cities/{id}

Get a specific city

GET
/prefectures/{id}/cities

List cities in a prefecture

Holidays
GET
/holidays

List holidays (current year)

GET
/holidays?year=2024

List holidays for a specific year

GET
/holidays/{id}

Get a specific holiday

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

CodeHTTP StatusDescription
UNAUTHORIZED401Missing or invalid API key
NOT_FOUND404Resource not found
RATE_LIMIT_EXCEEDED429Too many requests
SERVER_ERROR500Internal server error