In development — not finished yet; the API and site are coming soon.
Docs

API documentation

JSON over HTTP. Each endpoint returns plain objects you can model in any client; the field tables below describe the stable response shape. Where a resource embeds another (e.g. bounties on a character), that is called out explicitly.

Conventions
Shared rules across list endpoints.
  • Base URL: your deployment origin, or http://localhost:3000 locally.
  • Pagination: ?page= (1-based, default 1), ?limit= (default 20).
  • Timestamps: created_at values are ISO 8601 date-time strings (UTC).
  • Errors: failed requests return JSON { "error": string }. Most server errors return HTTP 500; some detail routes return 404 when an id is missing.
Discovery
Canonical production URLs for routes.

GET /api returns a small map of endpoint URLs (useful for clients and tooling).

{
  "characters": "https://onepieceapi.com/api/characters",
  "devilFruits": "https://onepieceapi.com/api/devil-fruits",
  "bounties": "https://onepieceapi.com/api/bounties"
}
Localized JSON fields
Some columns are stored as JSON and usually follow a shared shape.

Columns like characters.name, devil_fruits.name, and devil_fruits.model may be null or a localized JSON object. When localized, the convention is:

type CharacterNameJson = {
  en: string
  jp: string
  romaji: string
}

// Example
const name: CharacterNameJson = {
  en: "Monkey D. Luffy",
  jp: "モンキー・D・ルフィ",
  romaji: "Monkī Dī Rufi",
}

Clients typically pick a primary label in priority order enromaji jp.

Characters
Paginated characters; each item includes related bounties.

GET /api/characters

Query:

  • ?page= / ?limit= pagination.
  • ?q= searches localized name fields (en, jp, romaji) case-insensitively.
  • ?ageBand= filters numeric age with one of 0-12, 13-17, 18-29, 30-59, 60+. When set, rows with age = null are excluded.

Response: a JSON array of character objects. Each object includes the fields below, plus a bounties array of bounty objects (same shape as GET /api/bounties items).

Character object

FieldTypeNotes
idstringUUID primary key
created_atstringISO 8601 timestamp
nameobject | nullLocalized name; see CharacterNameJson when present
agenumber | null
birthdayobject | nullStructured birthday payload when present
blood_typestring
heightnumber | null
statusstring

Nested bounties[] items

FieldTypeNotes
idstringUUID primary key
created_atstringISO 8601 timestamp
amountnumber | null
character_idstring | nullFK → characters.id
is_activeboolean
Character detail
Fetch a single character by id (includes related bounties).

GET /api/characters/[id]

Response: a single character object (same fields as list items), or 404 when not found.

Bounties
Paginated bounty rows; optional filters and sort order.

GET /api/bounties

Query: ?isActive=true or ?isActive=false filters is_active. If omitted, no filter is applied (returns both active and inactive).

Sort: ?sort=high orders by amount descending (largest first); ?sort=low ascending (smallest first). Omit sort for newest first by created_at.

Response: a JSON array of bounty objects (fields below).

FieldTypeNotes
idstringUUID primary key
created_atstringISO 8601 timestamp
amountnumber | null
character_idstring | nullFK → characters.id
is_activeboolean
Devil fruits
Paginated devil fruit resources.

GET /api/devil-fruits

Query: pagination via ?page= / ?limit=.

Response: a JSON array of devil fruit objects (fields below).

FieldTypeNotes
idstringUUID primary key
created_atstringISO 8601 timestamp
nameobject | nullLocalized fruit name; CharacterNameJson when present (en, jp, romaji)
modelobject | nullLocalized model name; same CharacterNameJson shape when present
typestring | nulle.g. Paramecia, Zoan, Logia
sub_typestring | null
image_urlstring | null
Resources not exposed yet
Planned or internal data not available as HTTP endpoints today.

Affiliations, islands, and ships are part of the broader dataset but do not have public routes in this API yet. When they ship, they will be documented here with the same field-table style.