API Documentation

This API provides access to a comprehensive database of images and their associated metadata. This documentation aims to guide you through the usage of our API, detailing the available endpoints, parameters, and the structure of responses. Whether you're integrating with our service or utilizing the data for analysis, this guide will provide you with all the necessary information to effectively utilize our API.


Endpoints

Endpoints are specific paths in the API that you interact with to perform different actions. Below are the available endpoints for retrieving images and their details:

Retrieve All Images

GET artcode-api-document.tiiny.io/api.php?display=all_images

This endpoint allows you to retrieve a list of all images stored in the database. It's a comprehensive call that returns every image entry along with its metadata. This is useful for bulk retrieval or when you need to present a complete gallery of images.

Example Usage: Use this endpoint to load all images for a gallery view on a website or to generate a comprehensive image index.

Retrieve Image by ID

GET artcode-api-document.tiiny.io/api.php?artworkid={artworkid}

This endpoint retrieves detailed information about a specific image identified by its unique ID. This is particularly useful for fetching detailed metadata and content related to a single image.

Example Usage: When displaying a single image on a detail page, use this endpoint to fetch and show the image and its metadata, such as description, tags, and view count.

Retrieve All Images by User ID

GET artcode-api-document.tiiny.io/api.php?display=all_images&uid={uid}

This endpoint retrieves all images uploaded by a specific user, identified by their user ID. This is useful for displaying or managing images created or uploaded by a particular user.

Example Usage: Use this endpoint to create a user profile page that shows all images uploaded by the user, helping visitors view their contributions.


Parameters

Parameters are variables that you can pass in the API request to modify the output or filter the results. Below is a detailed explanation of each parameter you can use with the API:

Common Parameters
  • display (string): This parameter determines the type of response you will receive from the API. The available values include:
    • all_images: Retrieves a complete list of all images.
    • info: Retrieves detailed information about specific images or categories.
  • option (string): Specifies additional options for the response. Examples include:
    • image_child: When specified, includes child images associated with parent images.
  • artwork_type (string): Filters images based on their type. Examples include:
    • illustration: Filters to show only illustrations.
    • manga: Filters to show only manga images.
  • type (string): Filters images based on their content type. Examples include:
    • safe: Filters to show only images classified as safe.
    • nsfw: Filters to show only images classified as not safe for work.
  • artworkid (integer): The unique identifier for an artwork. Use this to retrieve specific images.
  • uid (integer): The unique identifier for a user. Use this to filter images associated with a particular user.
  • character (string): Filters images by specific characters. Provide character names to filter the results. For example, Character 1 will filter images featuring "Character 1".
  • parody (string): Filters images by parodies. Provide parody names to filter the results. For example, Parody 1 will filter images related to "Parody 1".
  • tag (string): Filters images by tags. Provide tag names to filter the results. For example, tag1 will filter images tagged with "tag1".
  • group (string): Filters images by groups. Provide group names to filter the results. For example, Group 1 will filter images associated with "Group 1".
  • search (string): Searches for images based on a keyword. This parameter allows you to search for images that match the specified keyword in their title, description, or tags.

Examples

Here are some detailed examples of how to use the API to retrieve various types of images. Each example includes the endpoint, parameters, and the expected result.

Example 1: Retrieve All Images

GET artcode-api-document.tiiny.io/api.php?display=all_images

This example demonstrates how to retrieve a list of all images available in the database. The response will include all image entries and their metadata.


              {
                {
                  "images": [
                    {
                      "id": 1,
                      "title": "Image 1",
                      "description": "A description of Image 1",
                      "tags": ["tag1", "tag2"],
                      "url": "http://example.com/image1.jpg"
                    },
                    ...
                  ]
                }
              }
              
Example 2: Search for Images

GET artcode-api-document.tiiny.io/api.php?search={keyword}

This example demonstrates how to search for images using a keyword. The API will return images that match the keyword in their title, description, or tags.


              {
                {
                  "images": [
                    {
                      "id": 2,
                      "title": "Search Result Image",
                      "description": "A description of the search result image",
                      "tags": ["search", "result"],
                      "url": "http://example.com/search-result-image.jpg"
                    },
                    ...
                }
              }
              
Example 2: Retrieve All Safe Images with Child Images

GET artcode-api-document.tiiny.io/api.php?display=all_images&option=image_child&type=safe

This request retrieves all images classified as safe and includes child images associated with those images. The option parameter is set to image_child, and the type parameter is set to safe.

Use Case: Use this endpoint when you need to display all safe images, including any child images, for content filtering or categorization purposes.


              {
                {
                "request": "GET /api.php?display=all_images&option=image_child&type=safe",
                "description": "Retrieves all images classified as safe and includes child images.",
                "parameters": {
                  "display": "all_images",
                  "option": "image_child",
                  "type": "safe"
                }
              }
              
Example 3: Retrieve All Images by User ID

GET artcode-api-document.tiiny.io/api.php?display=all_images&uid=1

This request retrieves all images associated with the user whose ID is 1. The uid parameter is used to filter the images by the specified user ID.

Use Case: This is useful for user profile pages where you want to show all images uploaded by a specific user.


              {
                {
                "request": "GET /api.php?display=all_images&uid=1",
                "description": "Retrieves all images associated with the user whose ID is 1.",
                "parameters": {
                  "display": "all_images",
                  "uid": 1
                }
              }
              
Example 4: Retrieve a Specific Image by ID

GET artcode-api-document.tiiny.io/api.php?artworkid=123

This request retrieves detailed information about the image with ID 123. The artworkid parameter specifies the unique ID of the image you want to retrieve.

Use Case: Use this endpoint when displaying a detailed view of a specific image, such as in a detail page or a modal.


              {
                {
                "request": "GET /api.php?artworkid=123",
                "description": "Retrieves detailed information about the image with ID 123.",
                "parameters": {
                  "artworkid": 123
                }
              }
              
Example 5: Retrieve Images by Character

GET artcode-api-document.tiiny.io/api.php?display=all_images&character=Character%201

This request retrieves all images that feature "Character 1". The character parameter is set to the name of the character you want to filter by.

Use Case: Useful for filtering images to show only those featuring a specific character, such as in a fan gallery or character-themed page.


              {
                {
                "request": "GET /api.php?display=all_images&character=Character%201",
                "description": "Retrieves all images that feature 'Character 1'.",
                "parameters": {
                  "display": "all_images",
                  "character": "Character 1"
                }
              }
              
Example 6: Retrieve Images by Parody

GET artcode-api-document.tiiny.io/api.php?display=all_images&parody=Parody%201

This request retrieves all images related to "Parody 1". The parody parameter filters the results to include only images associated with the specified parody.

Use Case: Ideal for showcasing all images related to a particular parody, which can be useful for thematic collections or galleries.


              {
                {
                "request": "GET /api.php?display=all_images&parody=Parody%201",
                "description": "Retrieves all images related to 'Parody 1'.",
                "parameters": {
                  "display": "all_images",
                  "parody": "Parody 1"
                }
              }
              
Example 7: Retrieve Images by Tag

GET artcode-api-document.tiiny.io/api.php?display=all_images&tag=tag1

This request retrieves all images that are tagged with "tag1". The tag parameter is used to filter images based on specific tags.

Use Case: Use this endpoint when you need to display images that share common tags, such as for thematic sorting or tag-based filtering.


              {
                {
                "request": "GET /api.php?display=all_images&tag=tag1",
                "description": "Retrieves all images that are tagged with 'tag1'.",
                "parameters": {
                  "display": "all_images",
                  "tag": "tag1"
                }
              }
              
Example 8: Retrieve Images by Group

GET artcode-api-document.tiiny.io/api.php?display=all_images&group=Group%201

This request retrieves all images that belong to "Group 1". The group parameter filters the results based on the group to which the images are associated.

Use Case: Useful for organizing and displaying images that belong to specific groups, such as collections or series.


              {
                {
                "request": "GET /api.php?display=all_images&group=Group%201",
                "description": "Retrieves all images that belong to 'Group 1'.",
                "parameters": {
                  "display": "all_images",
                  "group": "Group 1"
                }
              }
              
Example 9: Retrieve Images by Search

GET artcode-api-document.tiiny.io/api.php?display=all_images&search=Search%201

This request retrieves all images that match the search term "Search 1". The search parameter filters the results based on the search query.

Use Case: Useful for organizing and displaying images based on search queries, such as title, tags, groups, characters, or parodies.


              {
                {
                "request": "GET /api.php?display=all_images&search=Search%201",
                "description": "Retrieves all images that match the search term 'Search 1'.",
                "parameters": {
                  "display": "all_images",
                  "search": "Search 1"
                }
              }
              

Response Format

The API returns data in JSON format. This standardized format makes it easy to parse and integrate into various applications. Below is an example of a JSON response for retrieving all images:

{
            "images": [
              {
                "id": 1,
                "filename": "image1.jpg",
                "tags": "tag1, tag2",
                "title": "Image Title 1",
                "imgdesc": "Description of image 1",
                "link": "http://example.com",
                "date": "2024-08-18",
                "view_count": 100,
                "type": "safe",
                "episode_name": "Episode 1",
                "artwork_type": "manga",
                "group": "Group 1",
                "categories": "category1, category2",
                "language": "English",
                "parodies": "Parody 1",
                "characters": "Character 1",
                "original_filename": "original_image1.jpg"
              },
              {
                "id": 2,
                "filename": "image2.jpg",
                "tags": "tag3, tag4",
                "title": "Image Title 2",
                "imgdesc": "Description of image 2",
                "link": "http://example.com",
                "date": "2024-08-19",
                "view_count": 150,
                "type": "nsfw",
                "episode_name": "Episode 2",
                "artwork_type": "illustration",
                "group": "Group 2",
                "categories": "category3, category4",
                "language": "Japanese",
                "parodies": "Parody 2",
                "characters": "Character 2",
                "original_filename": "original_image2.jpg"
              }
            ]
          }

In the response:

  • images: An array of image objects, each containing detailed metadata about the image.
  • id: The unique identifier for the image.
  • filename: The name of the image file.
  • tags: Comma-separated tags associated with the image.
  • title: The title of the image.
  • imgdesc: A description of the image.
  • link: A URL link related to the image.
  • date: The date when the image was added.
  • view_count: The number of times the image has been viewed.
  • type: The content type classification of the image (e.g., safe or nsfw).
  • episode_name: The name of the episode if the image is part of a series.
  • artwork_type: The type of artwork (e.g., manga, illustration).
  • group: The group or collection to which the image belongs.
  • categories: Categories assigned to the image.
  • language: The language in which the image's content is presented.
  • parodies: Any parodies associated with the image.
  • characters: Characters featured in the image.
  • original_filename: The original file name of the image.