### GET /v0/users/{username}/collections/-/characters Source: https://bangumi.github.io/api/dist Retrieves a list of characters collected by a specific user. ```APIDOC ## GET /v0/users/{username}/collections/-/characters ### Description Retrieves a list of characters collected by a specific user. ### Method GET ### Endpoint /v0/users/{username}/collections/-/characters ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user. ### Response #### Success Response (200) - Description: Successful Response - Content: {"$ref": "#/components/schemas/Paged_UserCharacterCollection"} #### Error Response (404) - Description: 用户不存在 - Content: {"$ref": "#/components/schemas/ErrorDetail"} ``` -------------------------------- ### GET /v0/characters/{character_id} Source: https://bangumi.github.io/api/dist Retrieves detailed information about a specific character. The response is cached for 60 seconds. ```APIDOC ## GET /v0/characters/{character_id} ### Description Retrieves detailed information about a specific character. ### Method GET ### Endpoint /v0/characters/{character_id} ### Parameters #### Path Parameters - **character_id** (integer) - Required - The unique identifier for the character. ### Response #### Success Response (200) - **schema** (object) - A reference to the Character schema definition, containing character details. #### Error Response (400) - **schema** (object) - A reference to the ErrorDetail schema definition for validation errors. #### Error Response (404) - **schema** (object) - A reference to the ErrorDetail schema definition for not found errors. ``` -------------------------------- ### GET /v0/users/{username}/collections Source: https://bangumi.github.io/api/dist Retrieves a user's collection of items. Requires an access token to view private collections. ```APIDOC ## GET /v0/users/{username}/collections ### Description Retrieves a user's collection of items. Private collections can be viewed with an access token. ### Method GET ### Endpoint /v0/users/{username}/collections ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user whose collections are to be retrieved. #### Query Parameters - **subject_type** (SubjectType) - Optional - The type of items in the collection. Defaults to all. - **type** (SubjectCollectionType) - Optional - The type of collection. Defaults to all. - **limit** (integer) - Optional - The maximum number of results to return. Defaults to 20. - **offset** (integer) - Optional - The number of results to skip. Defaults to 0. ### Request Example ```json { "example": "GET /v0/users/testuser/collections?subject_type=anime&type=collect" } ``` ### Response #### Success Response (200) - **results** (array) - A list of user collections. - **total_count** (integer) - The total number of items in the collection. #### Response Example ```json { "example": { "results": [ { "subject_id": 1, "subject_name": "test anime", "subject_name_cn": "测试动画", "type": "collect", "status": { "name": "collect", "id": 1 }, "ep_status": 0, "last_ep_no": "", "rating": 8, "timestamp": "2023-01-01T12:00:00+08:00", "private": false } ], "total_count": 100 } } ``` #### Error Response (400) - **error** (object) - Details about the validation error. #### Error Response (404) - **error** (object) - Details about the user not found error. ``` -------------------------------- ### Get Person Image Source: https://bangumi.github.io/api/dist Retrieves the image associated with a specific person. The image size can be specified. ```APIDOC ## GET /v0/persons/{person_id}/image ### Description Retrieves the image for a given person ID. You can specify the desired image size. ### Method GET ### Endpoint `/v0/persons/{person_id}/image` ### Parameters #### Path Parameters - **person_id** (integer) - Required - The unique identifier of the person. #### Query Parameters - **type** (string) - Required - The desired image size. Accepted values: `small`, `grid`, `large`, `medium`. ### Request Example ```json { "example": "GET /v0/persons/123/image?type=large" } ``` ### Response #### Success Response (302) - **Location** (string) - The URL of the image. Returns a default image URL if no image is found. ``` -------------------------------- ### GET /v0/users/{username}/collections/-/persons Source: https://bangumi.github.io/api/dist Retrieves a list of persons collected by a specific user. ```APIDOC ## GET /v0/users/{username}/collections/-/persons ### Description Retrieves a list of persons collected by a specific user. ### Method GET ### Endpoint /v0/users/{username}/collections/-/persons ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user. ### Response #### Success Response (200) - Description: Successful Response - Content: {"$ref": "#/components/schemas/Paged_UserPersonCollection"} #### Error Response (404) - Description: 用户不存在 - Content: {"$ref": "#/components/schemas/ErrorDetail"} ``` -------------------------------- ### GET /v0/subjects Source: https://bangumi.github.io/api/dist Browse subjects with various filtering and sorting options. The first page is cached for 24 hours, subsequent pages for 1 hour. ```APIDOC ## GET /v0/subjects ### Description Browses subjects with various filtering and sorting options. Caching applies: first page 24h, others 1h. ### Method GET ### Endpoint /v0/subjects ### Parameters #### Query Parameters - **type** (SubjectType) - Required - The type of subject to retrieve. - **cat** (SubjectCategory) - Optional - The category of the subject. - **series** (boolean) - Optional - Filter for series subjects (valid for books). - **platform** (string) - Optional - Filter by platform (valid for games). - **sort** (string) - Optional - Sort order, enum values: {date|rank}. - **year** (integer) - Optional - Filter by year. - **month** (integer) - Optional - Filter by month. - **limit** (integer) - Optional - Pagination limit. - **offset** (integer) - Optional - Pagination offset. ### Request Example ```json { "example": "No request body for GET request" } ``` ### Response #### Success Response (200) - **Paged_Subject** (object) - Contains paginated subject data. #### Error Response (400) - **ErrorDetail** (object) - Validation error details. #### Error Response (404) - **ErrorDetail** (object) - Not found error details. #### Response Example ```json { "example": "Paged_Subject schema response" } ``` ``` -------------------------------- ### GET /v0/subjects/{subject_id}/image Source: https://bangumi.github.io/api/dist Fetches the image associated with a specific subject. You can specify the desired image size. ```APIDOC ## GET /v0/subjects/{subject_id}/image ### Description Fetches the image associated with a specific subject. You can specify the desired image size. ### Method GET ### Endpoint /v0/subjects/{subject_id}/image ### Parameters #### Path Parameters - **subject_id** (integer) - Required - The unique identifier for the subject. #### Query Parameters - **type** (string) - Required - The desired image size. Accepted values: "small", "grid", "large", "medium", "common". ### Response #### Success Response (302) - **Location** (string) - Header containing the URL of the image. Returns a default image URL if no image is found: https://lain.bgm.tv/img/no_icon_subject.png. #### Error Response (400) - **ErrorDetail** (object) - Describes a validation error. #### Error Response (404) - **ErrorDetail** (object) - Describes a not found error. ``` -------------------------------- ### GET /v0/users/{username}/collections/{subject_id} Source: https://bangumi.github.io/api/dist Retrieves a user's specific item collection. Requires an access token for private collections. ```APIDOC ## GET /v0/users/{username}/collections/{subject_id} ### Description Retrieves a specific item collection for a user. Private collections can be viewed with an access token. ### Method GET ### Endpoint /v0/users/{username}/collections/{subject_id} ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user. - **subject_id** (integer) - Required - The ID of the subject to retrieve the collection for. ### Request Example ```json { "example": "GET /v0/users/testuser/collections/123" } ``` ### Response #### Success Response (200) - **subject_id** (integer) - The ID of the subject. - **type** (string) - The type of collection (e.g., "collect", "wish", "do", "on_hold", "dropped"). - **status** (object) - Details about the collection status. - **rating** (integer) - The user's rating for the item (0-10). - **timestamp** (string) - The timestamp when the item was added to the collection. - **private** (boolean) - Whether the collection entry is private. #### Response Example ```json { "example": { "subject_id": 123, "type": "collect", "status": { "name": "collect", "id": 1 }, "rating": 9, "timestamp": "2023-01-01T12:00:00+08:00", "private": false } } ``` #### Error Response (400) - **error** (object) - Details about the validation error. ``` -------------------------------- ### GET /v0/users/{username}/collections/-/characters/{character_id} Source: https://bangumi.github.io/api/dist Retrieves detailed information about a specific character collected by a user. ```APIDOC ## GET /v0/users/{username}/collections/-/characters/{character_id} ### Description Retrieves detailed information about a specific character collected by a user. ### Method GET ### Endpoint /v0/users/{username}/collections/-/characters/{character_id} ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user. - **character_id** (integer) - Required - The ID of the character. ### Response #### Success Response (200) - Description: Successful Response - Content: {"$ref": "#/components/schemas/UserCharacterCollection"} #### Error Response (400) - Description: character ID not valid - Content: {"$ref": "#/components/schemas/ErrorDetail"} #### Error Response (404) - Description: 用户或角色不存在 - Content: {"$ref": "#/components/schemas/ErrorDetail"} ``` -------------------------------- ### GET /v0/characters/{character_id}/subjects Source: https://bangumi.github.io/api/dist Retrieves a list of subjects related to a specific character. ```APIDOC ## GET /v0/characters/{character_id}/subjects ### Description Retrieves a list of subjects related to a specific character. ### Method GET ### Endpoint /v0/characters/{character_id}/subjects ### Parameters #### Path Parameters - **character_id** (integer) - Required - The unique identifier for the character. ### Response #### Success Response (200) - **schema** (array) - An array of objects, where each object references the `v0_RelatedSubject` schema, representing subjects related to the character. #### Error Response (400) - **schema** (object) - A reference to the ErrorDetail schema definition for validation errors. #### Error Response (404) - **schema** (object) - A reference to the ErrorDetail schema definition for not found errors. ``` -------------------------------- ### Get Person Related Subjects Source: https://bangumi.github.io/api/dist Fetches a list of subjects related to a specific person. ```APIDOC ## GET /v0/persons/{person_id}/subjects ### Description Retrieves a list of subjects associated with a specific person. ### Method GET ### Endpoint `/v0/persons/{person_id}/subjects` ### Parameters #### Path Parameters - **person_id** (integer) - Required - The unique identifier of the person. ### Request Example ```json { "example": "GET /v0/persons/123/subjects" } ``` ### Response #### Success Response (200) - **items** (array) - An array of objects representing related subjects. - Each item conforms to the `v0_RelatedSubject` schema. #### Response Example ```json { "example": [ { "subject_id": 12345, "type": 2, "name": "Example Subject", "images": { "common": "http://example.com/image.jpg" } } ] } ``` ``` -------------------------------- ### Get Person Related Characters Source: https://bangumi.github.io/api/dist Fetches a list of characters related to a specific person. ```APIDOC ## GET /v0/persons/{person_id}/characters ### Description Retrieves a list of characters associated with a specific person. ### Method GET ### Endpoint `/v0/persons/{person_id}/characters` ### Parameters #### Path Parameters - **person_id** (integer) - Required - The unique identifier of the person. ### Request Example ```json { "example": "GET /v0/persons/123/characters" } ``` ### Response #### Success Response (200) - **items** (array) - An array of objects representing related characters. - Each item conforms to the `PersonCharacter` schema. #### Response Example ```json { "example": [ { "id": 67890, "name": "Example Character", "role_name": "Voice Actor" } ] } ``` ``` -------------------------------- ### GET /v0/characters/{character_id}/image Source: https://bangumi.github.io/api/dist Retrieves the image associated with a character, with options to specify the image size. ```APIDOC ## GET /v0/characters/{character_id}/image ### Description Retrieves the image associated with a character. ### Method GET ### Endpoint /v0/characters/{character_id}/image ### Parameters #### Path Parameters - **character_id** (integer) - Required - The unique identifier for the character. #### Query Parameters - **type** (string) - Required - Specifies the desired image size. Accepted values: `small`, `grid`, `large`, `medium`. ### Response #### Success Response (302) - **headers.Location** (string) - The URL of the character's image. If no image is found, it defaults to `https://lain.bgm.tv/img/no_icon_subject.png`. #### Error Response (400) - **schema** (object) - A reference to the ErrorDetail schema definition for validation errors. #### Error Response (404) - **schema** (object) - A reference to the ErrorDetail schema definition for not found errors. ``` -------------------------------- ### GET /v0/subjects/{subject_id}/characters Source: https://bangumi.github.io/api/dist Retrieves a list of characters associated with a specific subject. ```APIDOC ## GET /v0/subjects/{subject_id}/characters ### Description Retrieves a list of characters associated with a specific subject. ### Method GET ### Endpoint /v0/subjects/{subject_id}/characters ### Parameters #### Path Parameters - **subject_id** (integer) - Required - The unique identifier for the subject. ### Response #### Success Response (200) - **RelatedCharacter** (array) - An array of objects, each representing a character related to the subject. #### Error Response (400) - **ErrorDetail** (object) - Describes a validation error. #### Error Response (404) - **ErrorDetail** (object) - Describes a not found error. ``` -------------------------------- ### GET /v0/subjects/{subject_id} Source: https://bangumi.github.io/api/dist Retrieves detailed information about a specific subject using its ID. The response is cached for 300 seconds. ```APIDOC ## GET /v0/subjects/{subject_id} ### Description Retrieves detailed information about a specific subject using its ID. The response is cached for 300 seconds. ### Method GET ### Endpoint /v0/subjects/{subject_id} ### Parameters #### Path Parameters - **subject_id** (integer) - Required - The unique identifier for the subject. ### Response #### Success Response (200) - **Subject** (object) - Contains detailed information about the subject. #### Error Response (400) - **ErrorDetail** (object) - Describes a validation error. #### Error Response (404) - **ErrorDetail** (object) - Describes a not found error. ``` -------------------------------- ### GET /v0/users/{username}/collections/-/persons/{person_id} Source: https://bangumi.github.io/api/dist Retrieves the collection status of a specific person for a given user. This endpoint allows users to check if a particular person is part of their collection. ```APIDOC ## GET /v0/users/{username}/collections/-/persons/{person_id} ### Description Retrieves the collection status of a specific person for a given user. ### Method GET ### Endpoint /v0/users/{username}/collections/-/persons/{person_id} ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user. - **person_id** (integer) - Required - The ID of the person. ### Response #### Success Response (200) - **UserPersonCollection** (object) - Details about the user's collection of the person. #### Error Response (400) - **ErrorDetail** (object) - Returned if the person ID is not valid. #### Error Response (404) - **ErrorDetail** (object) - Returned if the user or person does not exist. ``` -------------------------------- ### GET /v0/revisions/characters Source: https://bangumi.github.io/api/dist Retrieves a paginated list of revisions for a specific character. This endpoint is useful for tracking changes made to character entries. ```APIDOC ## GET /v0/revisions/characters ### Description Retrieves a paginated list of revisions for a specific character. ### Method GET ### Endpoint /v0/revisions/characters ### Parameters #### Query Parameters - **character_id** (integer) - Required - The ID of the character. - **limit** (integer) - Optional - The maximum number of revisions to return. - **offset** (integer) - Optional - The number of revisions to skip. ### Response #### Success Response (200) - **Paged_Revision** (object) - A paginated list of character revisions. #### Error Response (400) - **ErrorDetail** (object) - Returned for validation errors. ``` -------------------------------- ### GET /v0/users/-/collections/{subject_id}/episodes Source: https://bangumi.github.io/api/dist Retrieves the collection status for episodes associated with a specific subject. This endpoint supports pagination and filtering by episode type. ```APIDOC ## GET /v0/users/-/collections/{subject_id}/episodes ### Description Retrieves the collection status for episodes associated with a specific subject. This endpoint supports pagination and filtering by episode type. ### Method GET ### Endpoint `/v0/users/-/collections/{subject_id}/episodes` ### Parameters #### Path Parameters - **subject_id** (integer) - Required - The ID of the subject whose episodes are being queried. #### Query Parameters - **offset** (integer) - Optional - The number of records to skip for pagination. - **limit** (integer) - Optional - The maximum number of records to return (default: 100, max: 1000). - **episode_type** (EpType) - Optional - Filters episodes by type. If not provided, no episode type filtering is applied. ### Response #### Success Response (200) - **Successful Response** - Contains the episode collection information. ``` -------------------------------- ### Legacy Blog Schema Source: https://bangumi.github.io/api/dist Defines the structure for a blog post object, including its ID, URL, title, summary, image, reply count, and creation timestamps. ```APIDOC ## Legacy Blog Schema ### Description Schema for a blog post object. ### Properties - **id** (integer) - ID - **url** (string) - 地址 - **title** (string) - 标题 - **summary** (string) - 概览 - **image** (string) - 图片 - **replies** (integer) - 回复数 - **timestamp** (integer) - 发布时间 - **dateline** (string) - 发布时间 - **user** (Legacy_User) - User object ### Examples #### Response Example ```json { "id": 789, "url": "https://example.com/blog/789", "title": "My Thoughts on Recent Anime", "summary": "A brief overview of my recent anime watching experience.", "image": "https://example.com/image.jpg", "replies": 15, "timestamp": 1357144903, "dateline": "2013-1-2 16:41", "user": { "id": 1, "url": "https://bgm.tv/user/sai", "username": "sai", "nickname": "Sai", "avatar": { "large": "https://lain.bgm.tv/pic/user/l/000/00/00/1.jpg?r=1391790456", "medium": "https://lain.bgm.tv/pic/user/m/000/00/00/1.jpg?r=1391790456", "small": "https://lain.bgm.tv/pic/user/s/000/00/00/1.jpg?r=1391790456" }, "sign": "Awesome!", "usergroup": "User" } } ``` ``` -------------------------------- ### POST /v0/indices Source: https://bangumi.github.io/api/dist Creates a new index. This endpoint allows users to add new indices to the system. ```APIDOC ## POST /v0/indices ### Description Creates a new index. This endpoint allows users to add new indices to the system. ### Method POST ### Endpoint /v0/indices ### Parameters #### Path Parameters (None) #### Query Parameters (None) #### Request Body (No explicit request body schema defined in the provided snippet, but typically would involve index details.) ### Request Example (No example provided) ### Response #### Success Response (200) - **Index** (object) - Represents the newly created index. #### Response Example (Schema reference: #/components/schemas/Index) #### Error Responses - **401** - Unauthorized (Schema reference: #/components/schemas/ErrorDetail) ``` -------------------------------- ### User Information Source: https://bangumi.github.io/api/dist This section describes the structure of user data returned by the API, including details like username, nickname, avatar, and user group. ```APIDOC ## User Object ### Description Represents a user on the platform. The actual return value may include an `url` field not declared in the documentation, which is primarily for developers to redirect directly to a web page from the API response. Client developers should not rely on this feature as its value may change at any time. ### Type object ### Properties - **id** (integer) - Required - User's unique identifier. - **username** (string) - Required - Unique username, initially the same as UID, can be modified once. - **nickname** (string) - Required - User's display name. - **user_group** (integer) - Required - User's group level, referencing the `UserGroup` schema. - **avatar** (object) - Required - User's avatar information, referencing the `Avatar` schema. - **sign** (string) - Optional - User's personal signature. ### Example ```json { "avatar": { "large": "https://lain.bgm.tv/pic/user/l/000/00/00/1.jpg?r=1391790456", "medium": "https://lain.bgm.tv/pic/user/m/000/00/00/1.jpg?r=1391790456", "small": "https://lain.bgm.tv/pic/user/s/000/00/00/1.jpg?r=1391790456" }, "sign": "Awesome!", "username": "sai", "nickname": "Sai🖖", "id": 1, "user_group": 1 } ``` ``` -------------------------------- ### Daily Broadcasts Source: https://bangumi.github.io/api/dist Retrieves a list of anime and other media broadcasted daily, categorized by day of the week. ```APIDOC ## GET /calendar ### Description Fetches daily broadcast information for various media. ### Method GET ### Endpoint /calendar ### Parameters #### Query Parameters None ### Request Example None ### Response #### Success Response (200) - **weekday** (object) - Information about the day of the week. - **en** (string) - English name of the day (e.g., "Mon"). - **cn** (string) - Chinese name of the day (e.g., "星期一"). - **ja** (string) - Japanese name of the day (e.g., "月耀日"). - **id** (integer) - Numeric identifier for the day (e.g., 1). - **items** (array) - A list of media items broadcast on this day. #### Response Example ```json [ { "weekday": { "en": "Mon", "cn": "星期一", "ja": "月耀日", "id": 1 }, "items": [ { "id": 12345, "type": 2, "name": "Example Anime Title", "name_cn": "示例动画标题", "summary": "A brief summary of the anime.", "air_date": "2023-10-02", "rating": { "total": 1000, "count": 800 }, "rank": 100, "images": { "large": "https://example.com/image_large.jpg", "medium": "https://example.com/image_medium.jpg", "small": "https://example.com/image_small.jpg", "grid": "https://example.com/image_grid.jpg" } } ] } ] ``` ``` -------------------------------- ### PUT /v0/users/{username}/collections/-/episodes/{episode_id} Source: https://bangumi.github.io/api/dist Updates the collection status for a specific episode. Requires authentication. ```APIDOC ## PUT /v0/users/{username}/collections/-/episodes/{episode_id} ### Description Updates the collection status for a specific episode. Requires authentication. ### Method PUT ### Endpoint /v0/users/{username}/collections/-/episodes/{episode_id} ### Parameters #### Path Parameters - **episode_id** (integer) - Required - The ID of the episode to update. #### Request Body - **type** (string) - Required - The new collection type for the episode (e.g., 'watched', 'queue'). ### Request Example ```json { "type": "watched" } ``` ### Response #### Success Response (204) - Description: Successful Response #### Error Response (400) - Description: episode ID not valid or subject not collected - Content: {"$ref": "#/components/schemas/ErrorDetail"} #### Error Response (401) - Description: not authorized - Content: {"$ref": "#/components/schemas/ErrorDetail"} #### Error Response (404) - Description: 条目或者章节不存在 - Content: {"$ref": "#/components/schemas/ErrorDetail"} ``` -------------------------------- ### User API Source: https://bangumi.github.io/api/dist Endpoints for retrieving user information and avatars. ```APIDOC ## GET /v0/users/{username} ### Description Get user information by username. ### Method GET ### Endpoint /v0/users/{username} ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user to retrieve. ### Response #### Success Response (200) - **User** (object) - Contains user details. #### Error Responses - **400**: Bad Request - Username is too long. - **404**: Not Found - Corresponding user does not exist. ``` ```APIDOC ## GET /v0/users/{username}/avatar ### Description Get a user's avatar by username. Returns a 302 redirect to the avatar URL. Cannot use UID to query after setting username. ### Method GET ### Endpoint /v0/users/{username}/avatar ### Parameters #### Path Parameters - **username** (string) - Required - The username of the user. #### Query Parameters - **type** (string) - Required - Type of avatar size. Enum values: {small|large|medium} ### Response #### Success Response (302) - **Location** (string) - URL of the user's avatar. If no avatar exists, returns the default avatar URL: https://lain.bgm.tv/pic/user/m/icon.jpg #### Error Responses - **400**: Bad Request - Username is too long. - **404**: Not Found - Corresponding user does not exist. ``` -------------------------------- ### GET /v0/characters/{character_id}/persons Source: https://bangumi.github.io/api/dist Retrieves a list of persons related to a specific character. ```APIDOC ## GET /v0/characters/{character_id}/persons ### Description Retrieves a list of persons related to a specific character. ### Method GET ### Endpoint /v0/characters/{character_id}/persons ### Parameters #### Path Parameters - **character_id** (integer) - Required - The unique identifier for the character. ### Response #### Success Response (200) - **schema** (array) - An array of objects, representing persons related to the character. (Specific schema details not provided in the input). #### Error Response (400) - **schema** (object) - A reference to the ErrorDetail schema definition for validation errors. #### Error Response (404) - **schema** (object) - A reference to the ErrorDetail schema definition for not found errors. ``` -------------------------------- ### Legacy User Schema Source: https://bangumi.github.io/api/dist Defines the structure for a user object, including their ID, profile URL, username, nickname, avatar details, signature, and user group. ```APIDOC ## Legacy User Schema ### Description Schema for a user object. ### Properties - **id** (integer) - 用户 id - **url** (string) - 用户主页地址 - **username** (string) - 用户名 - **nickname** (string) - 昵称 - **avatar** (object) - 头像地址 - **large** (string) - Large avatar URL - **medium** (string) - Medium avatar URL - **small** (string) - Small avatar URL - **sign** (string) - 签名 - **usergroup** (Legacy_UserGroup) - User group ### Examples #### Response Example ```json { "id": 1, "url": "https://bgm.tv/user/sai", "username": "sai", "nickname": "Sai", "avatar": { "large": "https://lain.bgm.tv/pic/user/l/000/00/00/1.jpg?r=1391790456", "medium": "https://lain.bgm.tv/pic/user/m/000/00/00/1.jpg?r=1391790456", "small": "https://lain.bgm.tv/pic/user/s/000/00/00/1.jpg?r=1391790456" }, "sign": "Awesome!", "usergroup": "User" } ``` ``` -------------------------------- ### GET /v0/indices/{index_id} Source: https://bangumi.github.io/api/dist Retrieves an index by its ID. This endpoint is used to fetch details of a specific index. ```APIDOC ## GET /v0/indices/{index_id} ### Description Retrieves an index by its ID. This endpoint is used to fetch details of a specific index. ### Method GET ### Endpoint /v0/indices/{index_id} ### Parameters #### Path Parameters - **index_id** (string) - Required - The ID of the index to retrieve. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **Index** (object) - Contains the details of the requested index. #### Response Example (Schema reference: #/components/schemas/Index) #### Error Responses - **404** - Not Found (Referenced as #/components/responses/404) ``` -------------------------------- ### Subject Categories Source: https://bangumi.github.io/api/dist Defines the different categories for subjects like Anime, Games, and Real-life content, along with their corresponding integer values and string representations. ```APIDOC ## Subject Categories Overview This section describes the various categories used to classify subjects within the Bangumi API. ### SubjectAnimeCategory An enum representing categories for anime. - `0`: Other - `1`: TV - `2`: OVA - `3`: Movie - `5`: WEB ### SubjectGameCategory An enum representing categories for games. - `0`: Other - `4001`: Games - `4003`: Expansion Pack - `4002`: Software - `4005`: Tabletop ### SubjectRealCategory An enum representing categories for real-life content (e.g., TV dramas, movies). - `0`: Other - `1`: Japanese Drama - `2`: Western Drama - `3`: Chinese Drama - `6001`: TV Series - `6002`: Movie - `6003`: Live Performance - `6004`: Variety Show ### SubjectCategory A union type that can represent any of the specific subject categories (Book, Anime, Game, Real). ``` -------------------------------- ### Schema Definitions Source: https://bangumi.github.io/api/dist This section details the structure of various data models used within the API, such as 'IndexSubject', 'Images', and 'ErrorDetail'. ```APIDOC ## Schema Definitions This section outlines the structure of key data objects used throughout the API. ### `IndexSubject` Object Represents a subject within an index, providing basic information. - **id** (integer) - Required - The unique identifier for the subject. - **type** (integer) - Required - The type of the subject (e.g., anime, manga). - **name** (string) - Required - The name of the subject. - **images** (object) - The image URLs for the subject. - **large** (string) - The URL for the large version of the image. - **common** (string) - The URL for the common version of the image. - **medium** (string) - The URL for the medium version of the image. - **small** (string) - The URL for the small version of the image. - **grid** (string) - The URL for the grid version of the image. - **infobox** (object) - Additional infobox details for the subject. - **comment** (integer) - Required - The comment count for the subject. - **added_at** (string) - Required - The timestamp when the subject was added. ### `Images` Object Contains different sizes of images for a subject. - **large** (string) - Required - URL of the large image. - **common** (string) - Required - URL of the common image. - **medium** (string) - Required - URL of the medium image. - **small** (string) - Required - URL of the small image. - **grid** (string) - Required - URL of the grid image. ### `ErrorDetail` Object Provides details about an API error. - **title** (string) - Required - A short title for the error. - **description** (string) - Required - A detailed description of the error. - **details** (string or object) - Optional - More specific error information. - If object, it may contain: - **error** (string) - The error message. - **path** (string) - The request path where the error occurred. ### `Index` Object Represents a collection or index of subjects. - **id** (integer) - Required - The unique identifier for the index. - **title** (string) - Required - The title of the index. - **desc** (string) - Required - A description of the index. - **total** (integer) - The total number of subjects in the index (defaults to 0). - **stat** (object) - Statistics related to the index (references `Stat` schema). - **created_at** (string) - Required - The timestamp when the index was created (format: date-time). - **updated_at** (string) - Required - The timestamp when the index was last updated (format: date-time). - **creator** (object) - Information about the creator of the index (references `Creator` schema). - **ban** (boolean) - Deprecated - This field is deprecated and always false. - **nsfw** (boolean) - Indicates if the index contains NSFW content. ### `NameCn` Object Represents the Chinese name of a subject. - **title** (string) - The Chinese title. - **type** (string) - The type of the name (e.g., 'string'). ### `Sort` Object Details about the sorting and episode count for a subject. - **title** (string) - The title of the sort field. - **type** (string) - The type of the sort field (e.g., 'number'). - **description** (string) - Description explaining the sort order and episode count. ### `Ep` Object Represents episode information for a subject. - **title** (string) - The title of the episode field. - **type** (string) - The type of the episode field (e.g., 'number'). - **description** (string) - Description of the episode count within the subject, starting from 1. Non-primary episodes may have no meaning for this field. ### `Airdate` Object Represents the air date of a subject. - **title** (string) - The title of the airdate field. - **type** (string) - The type of the airdate field (e.g., 'string'). ### `Comment` Object Represents the comment count for a subject. - **title** (string) - The title of the comment field. - **type** (string) - The type of the comment field (e.g., 'integer'). ### `Duration` Object Represents the duration of an episode or media. - **title** (string) - The title of the duration field. - **type** (string) - The type of the duration field (e.g., 'string'). ### `Desc` Object Represents a description for a subject. - **title** (string) - The title of the description field. - **type** (string) - The type of the description field (e.g., 'string'). - **description** (string) - A brief description of the subject. ### `Disc` Object Represents the disc count for music releases. - **title** (string) - The title of the disc field. - **type** (string) - The type of the disc field (e.g., 'integer'). - **description** (string) - The number of discs in a music release. ### `SubjectID` Object Represents the subject ID. - **title** (string) - The title of the subject ID field. - **type** (string) - The type of the subject ID field (e.g., 'integer'). ``` -------------------------------- ### User Episode Collection Schema Source: https://bangumi.github.io/api/dist Defines the structure for a user's episode collection, including the episode details, collection type, and update timestamp. ```APIDOC ## UserEpisodeCollection Schema ### Description Represents a user's collection status for a specific episode. ### Schema Details - **episode** (object) - Required - The episode object. - **type** (object) - Required - The type of collection (e.g., watched, collected). - **updated_at** (integer) - Required - A int64 unix timestamp, `0` as unknown or un-recorded. ``` -------------------------------- ### GET /v0/indices/{index_id}/subjects Source: https://bangumi.github.io/api/dist Retrieves subjects associated with a specific index. This endpoint can be filtered by subject type. ```APIDOC ## GET /v0/indices/{index_id}/subjects ### Description Retrieves subjects associated with a specific index. This endpoint can be filtered by subject type. ### Method GET ### Endpoint /v0/indices/{index_id}/subjects ### Parameters #### Path Parameters - **index_id** (string) - Required - The ID of the index whose subjects are to be retrieved. #### Query Parameters - **type** (SubjectType) - Optional - Filters subjects by type. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) (Response schema not fully detailed in snippet, but would likely be a list of subjects.) #### Response Example (No example provided) ``` -------------------------------- ### GET /v0/subjects/{subject_id}/persons Source: https://bangumi.github.io/api/dist Retrieves a list of persons associated with a specific subject, such as directors, writers, or voice actors. ```APIDOC ## GET /v0/subjects/{subject_id}/persons ### Description Retrieves a list of persons associated with a specific subject, such as directors, writers, or voice actors. ### Method GET ### Endpoint /v0/subjects/{subject_id}/persons ### Parameters #### Path Parameters - **subject_id** (integer) - Required - The unique identifier for the subject. ### Response #### Success Response (200) - **RelatedPerson** (array) - An array of objects, each representing a person related to the subject. #### Error Response (400) - **ErrorDetail** (object) - Describes a validation error. #### Error Response (404) - **ErrorDetail** (object) - Describes a not found error. ``` -------------------------------- ### Search Subjects Source: https://bangumi.github.io/api/dist Provides experimental functionality to search for subjects (e.g., anime, manga) based on various criteria. ```APIDOC ## POST /v0/search/subjects ### Description This is an experimental API. The schema and behavior may change at any time. Supports filtering by type, tag, air date, rating, rating count, rank, and NSFW content. ### Method POST ### Endpoint /v0/search/subjects ### Parameters #### Query Parameters - **limit** (integer) - Optional - Pagination parameter for the number of results per page. - **offset** (integer) - Optional - Pagination parameter for the starting offset of results. #### Request Body - **keyword** (string) - Required - The search term. - **sort** (string) - Optional - Sorting rule for the results. Enum: `match`, `heat`, `rank`, `score`. Defaults to `match`. - `match`: Default Meilisearch sorting by relevance. - `heat`: Sort by the number of collections. - `rank`: Sort by rank (high to low). - `score`: Sort by rating. - **filter** (object) - Optional - Filtering criteria. Multiple conditions are combined with AND logic. - **type** (array of SubjectType) - Optional - Item types to filter by. Multiple values are OR'd together. - **meta_tags** (array of string) - Optional - Filter by metadata tags (e.g., "童年", "原创"). ### Request Example ```json { "keyword": "Bocchi the Rock", "sort": "rank", "filter": { "type": ["anime"], "meta_tags": ["music"] } } ``` ### Response #### Success Response (200) - **items** (array) - A list of subject search results. - Each item will contain details about the subject, similar to `Legacy_SubjectSmall` schema. #### Response Example ```json { "keyword": "Bocchi the Rock", "limit": 10, "offset": 0, "found": 5, "items": [ { "id": 429900, "type": 2, "name": "ぼっち・ざ・ろっく!", "name_cn": "孤独摇滚!", "summary": "...", "air_date": "2022-10-08", "rating": { "total": 10000, "count": 9500 }, "rank": 5, "images": { "large": "...", "medium": "...", "small": "...", "grid": "..." } } ] } ``` ``` -------------------------------- ### GET /v0/revisions/episodes/{revision_id} Source: https://bangumi.github.io/api/dist Retrieves a specific episode revision by its ID. This endpoint is useful for viewing the history of episode changes. ```APIDOC ## GET /v0/revisions/episodes/{revision_id} ### Description Retrieves a specific episode revision by its ID. This endpoint is useful for viewing the history of episode changes. ### Method GET ### Endpoint /v0/revisions/episodes/{revision_id} ### Parameters #### Path Parameters - **revision_id** (string) - Required - The ID of the revision to retrieve. ### Request Example (No request body for GET requests) ### Response #### Success Response (200) - **DetailedRevision** (object) - Contains detailed information about the episode revision. #### Response Example (Schema reference: #/components/schemas/DetailedRevision) #### Error Responses - **400** - Validation Error (Schema reference: #/components/schemas/ErrorDetail) - **404** - Not Found (Schema reference: #/components/schemas/ErrorDetail) ```