# One Piece API
> The world of One Piece as an API — the characters, pirate crews and Devil Fruits of Eiichiro Oda's saga. Look up a character by id or name (e.g. Monkey D. Luffy → 3,000,000,000 berry bounty, captain of the Straw Hat Pirates, user of the Hito Hito no Mi, Model: Nika), browse the pirate crews with their total bounty, member count and Yonko status, and search the Devil Fruits by name for their type (Paramecia, Zoan, Logia) and powers. Backed by the open api-onepiece.com dataset. Ideal for fan sites, trivia and quiz games, bounty and crew trackers, Discord bots and any One Piece app.

## Authentication
All requests require your oanor API key in the `x-oanor-key` header. Get one at https://www.oanor.com/developer/keys.

```bash
curl -H "x-oanor-key: oanor_live_…" "https://api.oanor.com/onepiece-api/..."
```

## Pricing
- **Free** (Free) — 10,400 calls/Mo, 2 req/s
- **Starter** ($3/Mo) — 150,000 calls/Mo, 8 req/s
- **Pro** ($10/Mo) — 680,000 calls/Mo, 20 req/s
- **Mega** ($32/Mo) — 2,790,000 calls/Mo, 50 req/s

## Endpoints

### One Piece

#### `GET /v1/character` — A character by id or name

**Parameters:**
- `id` (query, optional, string) — Character id, e.g. 1 (Luffy) Example: `1`
- `name` (query, optional, string) — Name search, e.g. luffy

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/onepiece-api/v1/character?id=1"
```

**Response:**
```json
{
    "data": {
        "character": {
            "id": 1,
            "age": "19 ans",
            "job": "Captain",
            "crew": "The Chapeau de Paille crew",
            "name": "Monkey D Luffy",
            "size": "174cm",
            "fruit": "Hito Hito no Mi, Nika model",
            "bounty": "3.000.000.000",
            "status": "vivant"
        }
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:24.708Z",
        "request_id": "48ac69df-ec67-4b69-a3c8-5bb3a5e49bf0"
    },
    "status": "ok",
    "message": "Character retrieved",
    "success": true
}
```

#### `GET /v1/crew` — A pirate crew by id or name

**Parameters:**
- `id` (query, optional, string) — Crew id, e.g. 1 Example: `1`
- `name` (query, optional, string) — Name search, e.g. straw

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/onepiece-api/v1/crew?id=1"
```

**Response:**
```json
{
    "data": {
        "crew": {
            "id": 1,
            "name": "The Chapeau de Paille crew",
            "status": "assets",
            "is_yonko": true,
            "roman_name": "Mugiwara no Ichimi",
            "description": null,
            "member_count": "10",
            "total_bounty": "3.161.000.100"
        }
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:24.895Z",
        "request_id": "6e69d37e-83ff-47c6-864d-5e7ac4d3e1e9"
    },
    "status": "ok",
    "message": "Crew retrieved",
    "success": true
}
```

#### `GET /v1/fruit` — A Devil Fruit by id or name

**Parameters:**
- `id` (query, optional, string) — Fruit id, e.g. 1 Example: `1`
- `name` (query, optional, string) — Name search, e.g. gum

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/onepiece-api/v1/fruit?id=1"
```

**Response:**
```json
{
    "data": {
        "fruit": {
            "id": 1,
            "name": "Gum-Gum Fruit",
            "type": "Paramecia",
            "roman_name": "Gomu Gomu no Mi",
            "description": "Gomu Gomu no Mi, also known as the Fruit of Gum-Gum in French, is a Paramecia-type Demon Fruit that imparts the same properties as rubber to its user's body, making the eater an Elastic Man (ゴム人間, Gomu Ningen). This was once a treasure that Shanks and his crew had taken from a World Government convoy, protected by CP9, but which was accidentally eaten by Monkey D. Luffy"
        }
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:25.149Z",
        "request_id": "6d07050b-8ca8-405a-aa97-fb5225f13283"
    },
    "status": "ok",
    "message": "Fruit retrieved",
    "success": true
}
```

### Meta

#### `GET /v1/meta` — Usage notes

**Example:**
```bash
curl -H "x-oanor-key: $KEY" \
  "https://api.oanor.com/onepiece-api/v1/meta"
```

**Response:**
```json
{
    "data": {
        "note": "The world of One Piece. /v1/character = a character by id or name search (e.g. id=1 → Monkey D. Luffy, bounty, crew, Devil Fruit, job, status); /v1/crew = a pirate crew by id or name (description, total bounty, Yonko status); /v1/fruit = a Devil Fruit by id or name (type, description). Pass id= for an exact record or name= to search.",
        "source": "api-onepiece.com",
        "endpoints": [
            "/v1/character",
            "/v1/crew",
            "/v1/fruit",
            "/v1/meta"
        ]
    },
    "meta": {
        "timestamp": "2026-06-01T00:04:25.218Z",
        "request_id": "132f3891-df61-4c00-8139-b27ee65d1427"
    },
    "status": "ok",
    "message": "Meta retrieved",
    "success": true
}
```


---
Marketplace page: https://www.oanor.com/api/onepiece-api
OpenAPI spec: https://www.oanor.com/api/onepiece-api/openapi.json
